Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: libadblockplus-android/jni/Android.mk

Issue 29557565: Issue 5800 - Add option to specify a list of V8 libraries (Closed)
Patch Set: Using space as separator, README changes Created Oct. 11, 2017, 5:47 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « README.md ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: libadblockplus-android/jni/Android.mk
diff --git a/libadblockplus-android/jni/Android.mk b/libadblockplus-android/jni/Android.mk
index d152a10bfe00bfc1360a9bef4cbe44cebf132adc..df94536b6f10908b22554e62fa71559cbdfb88cc 100755
--- a/libadblockplus-android/jni/Android.mk
+++ b/libadblockplus-android/jni/Android.mk
@@ -1,5 +1,19 @@
LOCAL_PATH := $(call my-dir)
+# Report configuration
+ifeq ($(SHARED_V8_LIB_FILENAMES),)
+# static
+$(info [Configuration] Linking statically with built-in v8)
+else
+# dynamic
+
+define info_define
+ $(info [Configuration] Linking dynamically with shared v8 library ./libadblockplus-binaries/android_$(TARGET_ARCH_ABI)/$1)
+endef
+$(foreach item,$(SHARED_V8_LIB_FILENAMES),$(eval $(call info_define,$(item))))
+endif
+
+# libadblockplus.a
include $(CLEAR_VARS)
LOCAL_MODULE := libadblockplus
@@ -7,6 +21,18 @@ LOCAL_SRC_FILES := ./libadblockplus-binaries/android_$(TARGET_ARCH_ABI)/libadblo
include $(PREBUILT_STATIC_LIBRARY)
+# libv8-platform.a
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := v8-libplatform
+LOCAL_SRC_FILES := ./libadblockplus-binaries/android_$(TARGET_ARCH_ABI)/libv8_libplatform.a
+
+include $(PREBUILT_STATIC_LIBRARY)
+
+ifeq ($(SHARED_V8_LIB_FILENAMES),)
+# static
+
+# libv8-libsampler.a
include $(CLEAR_VARS)
LOCAL_MODULE := v8-libsampler
@@ -14,6 +40,7 @@ LOCAL_SRC_FILES := ./libadblockplus-binaries/android_$(TARGET_ARCH_ABI)/libv8_li
include $(PREBUILT_STATIC_LIBRARY)
+# libv8-base.a
include $(CLEAR_VARS)
LOCAL_MODULE := v8-base
@@ -21,6 +48,7 @@ LOCAL_SRC_FILES := ./libadblockplus-binaries/android_$(TARGET_ARCH_ABI)/libv8_ba
include $(PREBUILT_STATIC_LIBRARY)
+# libv8_libbase.a
include $(CLEAR_VARS)
LOCAL_MODULE := v8-libbase
@@ -28,19 +56,30 @@ LOCAL_SRC_FILES := ./libadblockplus-binaries/android_$(TARGET_ARCH_ABI)/libv8_li
include $(PREBUILT_STATIC_LIBRARY)
+# libv8_snapshot.a
include $(CLEAR_VARS)
-LOCAL_MODULE := v8-libplatform
-LOCAL_SRC_FILES := ./libadblockplus-binaries/android_$(TARGET_ARCH_ABI)/libv8_libplatform.a
+LOCAL_MODULE := v8-snapshot
+LOCAL_SRC_FILES := ./libadblockplus-binaries/android_$(TARGET_ARCH_ABI)/libv8_snapshot.a
include $(PREBUILT_STATIC_LIBRARY)
-include $(CLEAR_VARS)
+else
+# dynamic
-LOCAL_MODULE := v8-snapshot
-LOCAL_SRC_FILES := ./libadblockplus-binaries/android_$(TARGET_ARCH_ABI)/libv8_snapshot.a
+# prebuilt shared libraries v8
-include $(PREBUILT_STATIC_LIBRARY)
+define libv8_define
+ include $(CLEAR_VARS)
+
+ LOCAL_MODULE := $1
+ LOCAL_SRC_FILES := ./libadblockplus-binaries/android_$(TARGET_ARCH_ABI)/$1
+
+ include $(PREBUILT_SHARED_LIBRARY)
+endef
+$(foreach item,$(SHARED_V8_LIB_FILENAMES),$(eval $(call libv8_define,$(item))))
+
+endif
include $(CLEAR_VARS)
@@ -55,10 +94,19 @@ LOCAL_SRC_FILES += JniFilterChangeCallback.cpp JniCallbacks.cpp Utils.cpp
LOCAL_SRC_FILES += JniNotification.cpp JniShowNotificationCallback.cpp
LOCAL_SRC_FILES += JniIsAllowedConnectionTypeCallback.cpp
-LOCAL_CPP_FEATURES := exceptions
+LOCAL_CPP_FEATURES := exceptions
LOCAL_CPPFLAGS += -std=c++11
LOCAL_C_INCLUDES := jni/libadblockplus-binaries/include/
-LOCAL_STATIC_LIBRARIES := libadblockplus v8-base v8-snapshot v8-libsampler v8-libplatform v8-libbase
+
+LOCAL_STATIC_LIBRARIES := libadblockplus v8-libplatform
+
+ifeq ($(SHARED_V8_LIB_FILENAMES),)
+# static
+LOCAL_STATIC_LIBRARIES += v8-base v8-snapshot v8-libsampler v8-libbase
+else
+# dynamic
+LOCAL_STATIC_LIBRARIES += $(SHARED_V8_LIB_FILENAMES)
+endif
include $(BUILD_SHARED_LIBRARY)
« no previous file with comments | « README.md ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld