diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2016-11-17 16:40:14 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2016-11-18 14:45:42 +0100 |
commit | ce0169e189963552295dba780886e1009c83ccec (patch) | |
tree | b34d257e2b9ab0345c7598d793c1ac914f133375 | |
parent | 109565c4006cd5909972f1388c2c561c0c4a745e (diff) | |
download | qtlocation-mapboxgl-ce0169e189963552295dba780886e1009c83ccec.tar.gz |
[build] add --gc-sections to Android link flags to reduce binary size
-rw-r--r-- | platform/android/config.cmake | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/platform/android/config.cmake b/platform/android/config.cmake index 74412e4ae5..beae982f18 100644 --- a/platform/android/config.cmake +++ b/platform/android/config.cmake @@ -67,6 +67,8 @@ macro(mbgl_platform_core) target_compile_options(mbgl-core PRIVATE -fvisibility=hidden + PRIVATE -ffunction-sections + PRIVATE -fdata-sections PRIVATE -Os ) @@ -78,6 +80,7 @@ macro(mbgl_platform_core) PUBLIC -lstdc++ PUBLIC -latomic PUBLIC -lz + PUBLIC -Wl,--gc-sections ) endmacro() @@ -148,11 +151,14 @@ target_add_mason_package(mapbox-gl PUBLIC rapidjson) target_compile_options(mapbox-gl PRIVATE -fvisibility=hidden + PRIVATE -ffunction-sections + PRIVATE -fdata-sections PRIVATE -Os ) target_link_libraries(mapbox-gl PUBLIC mbgl-core + PUBLIC -Wl,--gc-sections ) add_library(example-custom-layer SHARED @@ -161,11 +167,14 @@ add_library(example-custom-layer SHARED target_compile_options(example-custom-layer PRIVATE -fvisibility=hidden + PRIVATE -ffunction-sections + PRIVATE -fdata-sections PRIVATE -Os ) target_link_libraries(example-custom-layer PRIVATE mbgl-core + PUBLIC -Wl,--gc-sections ) set(ANDROID_SDK_PROJECT_DIR ${CMAKE_SOURCE_DIR}/platform/android/MapboxGLAndroidSDK) |