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: Supporting multiple libraries Created Sept. 27, 2017, 12:13 p.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..2bef783dab1d6a0334fb476f2f87610972899f62 100755
--- a/libadblockplus-android/jni/Android.mk
+++ b/libadblockplus-android/jni/Android.mk
@@ -1,5 +1,20 @@
LOCAL_PATH := $(call my-dir)
+# Report configuration
+ifeq ($(SHARED_V8_LIB_FILENAME),)
+# static
+$(info [Configuration] Linking statically with built-in v8)
+else
+# dynamic
+
+SHARED_V8_LIB_FILENAME_LIST = $(subst :, ,$(SHARED_V8_LIB_FILENAME))
+define info_define
+ $(info [Configuration] Linking dynamically with shared v8 library ./libadblockplus-binaries/android_$(TARGET_ARCH_ABI)/$1)
+endef
+$(foreach item,$(SHARED_V8_LIB_FILENAME_LIST),$(eval $(call info_define,$(item))))
+endif
+
+# libadblockplus.a
include $(CLEAR_VARS)
LOCAL_MODULE := libadblockplus
@@ -7,6 +22,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_FILENAME),)
+# static
+
+# libv8-libsampler.a
include $(CLEAR_VARS)
LOCAL_MODULE := v8-libsampler
@@ -14,6 +41,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 +49,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 +57,31 @@ 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)
+SHARED_V8_LIB_FILENAME_LIST = $(subst :, ,$(SHARED_V8_LIB_FILENAME))
+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_FILENAME_LIST),$(eval $(call libv8_define,$(item))))
sergei 2017/09/28 08:08:41 I find it very good that we are looping here throu
sergei 2017/09/28 09:15:27 What about replacing LIB_FILENAME by something lik
anton 2017/09/28 11:01:38 For Android syntax we pass full (absolute or relat
sergei 2017/09/28 11:35:00 This is still opened.
+
+endif
include $(CLEAR_VARS)
@@ -55,10 +96,20 @@ 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
sergei 2017/09/28 09:15:27 I'm not sure that "v8-libplatform" should be alway
anton 2017/09/28 11:01:38 I tend to agree with it.
sergei 2017/10/02 09:12:02 So, what is the decision regarding v8-libplatform?
anton 2017/10/02 09:22:04 i'd say for now we should leave it as in review (r
sergei 2017/10/02 10:08:01 Acknowledged.
+
+ifeq ($(SHARED_V8_LIB_FILENAME),)
+# static
+LOCAL_STATIC_LIBRARIES += v8-base v8-snapshot v8-libsampler v8-libbase
+else
+# dynamic
+SHARED_V8_LIB_FILENAME_LIST = $(subst :, ,$(SHARED_V8_LIB_FILENAME))
+LOCAL_STATIC_LIBRARIES += $(SHARED_V8_LIB_FILENAME_LIST)
+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