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: Created Sept. 27, 2017, 9:10 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..60a18adb4bff83d3319ba333828e569da55402d5 100755
--- a/libadblockplus-android/jni/Android.mk
+++ b/libadblockplus-android/jni/Android.mk
@@ -1,5 +1,15 @@
LOCAL_PATH := $(call my-dir)
+# Report configuration
+ifeq ($(SHARED_V8_LIB_FILENAME),)
+# static
+$(info [Configuration] Linking statically with built-in v8)
+else
+# dynamic
+$(info [Configuration] Linking dynamically with shared v8 library ./libadblockplus-binaries/android_$(TARGET_ARCH_ABI)/$(SHARED_V8_LIB_FILENAME))
+endif
+
+# libadblockplus.a
include $(CLEAR_VARS)
LOCAL_MODULE := libadblockplus
@@ -7,6 +17,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 +36,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 +44,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 +52,25 @@ 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)
+else
+# dynamic
+
+# prebuilt shared library v8
include $(CLEAR_VARS)
-LOCAL_MODULE := v8-snapshot
-LOCAL_SRC_FILES := ./libadblockplus-binaries/android_$(TARGET_ARCH_ABI)/libv8_snapshot.a
+LOCAL_MODULE := libv8
+LOCAL_SRC_FILES := ./libadblockplus-binaries/android_$(TARGET_ARCH_ABI)/$(SHARED_V8_LIB_FILENAME)
+include $(PREBUILT_SHARED_LIBRARY)
-include $(PREBUILT_STATIC_LIBRARY)
+endif
include $(CLEAR_VARS)
@@ -55,10 +85,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_FILENAME),)
+# static
+LOCAL_STATIC_LIBRARIES += v8-base v8-snapshot v8-libsampler v8-libbase
+else
+# dynamic
+LOCAL_STATIC_LIBRARIES += libv8
+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