Only export shared library as prefab

This commit is contained in:
LoveSy 2022-02-19 03:05:57 +08:00
parent 9d53832929
commit 49714ca405
4 changed files with 26 additions and 4 deletions

View File

@ -40,6 +40,15 @@ android {
prefab {
create("lsplant") {
headers = "jni/include"
libraryName = "liblsplant"
name = "lsplant"
}
// only for unit test
create("dex_builder") {
headers = "jni/external/dex_builder/include"
libraryName = "libdex_builder"
name = "dex_builder"
}
}

View File

@ -6,9 +6,22 @@ LOCAL_MODULE := lsplant
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
LOCAL_SRC_FILES := lsplant.cc
LOCAL_EXPORT_C_INCLUDES:= $(LOCAL_PATH)/include
LOCAL_STATIC_LIBRARIES := dex_builder
LOCAL_EXPORT_LDLIBS := -llog
LOCAL_SHARED_LIBRARIES := dex_builder
LOCAL_LDLIBS := -llog
LOCAL_EXPORT_LDLIBS := $(LOCAL_LDLIBS)
LOCAL_CFLAGS := -flto
LOCAL_LDFLAGS := -flto
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := lsplant_static
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
LOCAL_SRC_FILES := lsplant.cc
LOCAL_EXPORT_C_INCLUDES:= $(LOCAL_PATH)/include
LOCAL_STATIC_LIBRARIES := dex_builder_static
LOCAL_EXPORT_LDLIBS := -llog
include $(BUILD_STATIC_LIBRARY)
include jni/external/dex_builder/Android.mk

@ -1 +1 @@
Subproject commit 6273ec71c0c4ded162f1569c94eac098c5f87e02
Subproject commit 850add0912f11dc9b52fd13e4b52e5a4b20733eb

View File

@ -13,7 +13,7 @@
#include "art/runtime/art_method.hpp"
#include "art/thread_list.hpp"
#include "art/runtime/class_linker.hpp"
#include "external/dex_builder/dex_builder.h"
#include "dex_builder.h"
#include "common.hpp"
#pragma clang diagnostic push