summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-03-13 16:54:02 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-03-14 09:28:49 -0700
commit1850da14653e2d2419ec1d08c25bcb88d0c96b98 (patch)
tree1dcbc86b7c0885e1dc16bfd2bac0746a339937c2
parent48e17724a12601ebd76009990bc46f82519b1a76 (diff)
downloadqtlocation-mapboxgl-1850da14653e2d2419ec1d08c25bcb88d0c96b98.tar.gz
[android] Link with a version script to restrict symbol visibility
-rw-r--r--platform/android/config.cmake2
-rw-r--r--platform/android/version-script4
2 files changed, 6 insertions, 0 deletions
diff --git a/platform/android/config.cmake b/platform/android/config.cmake
index 3dd8e7f67d..fdf03b4ec8 100644
--- a/platform/android/config.cmake
+++ b/platform/android/config.cmake
@@ -248,6 +248,7 @@ target_compile_options(mapbox-gl
target_link_libraries(mapbox-gl
PUBLIC mbgl-core
PUBLIC -Wl,--gc-sections
+ PUBLIC -Wl,--version-script=${CMAKE_SOURCE_DIR}/platform/android/version-script
)
# Create a stripped version of the library and copy it to the JNIDIR.
@@ -331,6 +332,7 @@ target_compile_options(example-custom-layer
target_link_libraries(example-custom-layer
PRIVATE mapbox-gl
PUBLIC -Wl,--gc-sections
+ PUBLIC -Wl,--version-script=${CMAKE_SOURCE_DIR}/platform/android/version-script
)
add_custom_command(TARGET example-custom-layer POST_BUILD
diff --git a/platform/android/version-script b/platform/android/version-script
new file mode 100644
index 0000000000..7c1e3d54a2
--- /dev/null
+++ b/platform/android/version-script
@@ -0,0 +1,4 @@
+{
+ global: JNI_OnLoad;
+ local: *;
+}; \ No newline at end of file