From 0eede631cec6c62184dfdc1525c9d904843f8f98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Thu, 8 Dec 2016 12:30:42 +0100 Subject: [build] only use Identical Code Folding on platforms that support the gold linker --- platform/android/config.cmake | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'platform/android/config.cmake') diff --git a/platform/android/config.cmake b/platform/android/config.cmake index 4901eda5e5..32745720e5 100644 --- a/platform/android/config.cmake +++ b/platform/android/config.cmake @@ -11,6 +11,13 @@ set(CMAKE_C_ARCHIVE_CREATE " cruT ") set(CMAKE_CXX_ARCHIVE_APPEND " ruT ") set(CMAKE_C_ARCHIVE_APPEND " ruT ") +if ((ANDROID_ABI STREQUAL "armeabi") OR (ANDROID_ABI STREQUAL "armeabi-v7a") OR (ANDROID_ABI STREQUAL "arm64-v8a") OR + (ANDROID_ABI STREQUAL "x86") OR (ANDROID_ABI STREQUAL "x86_64")) + # Use Identical Code Folding on platforms that support the gold linker. + set(CMAKE_EXE_LINKER_FLAGS "-fuse-ld=gold -Wl,--icf=safe ${CMAKE_EXE_LINKER_FLAGS}") + set(CMAKE_SHARED_LINKER_FLAGS "-fuse-ld=gold -Wl,--icf=safe ${CMAKE_SHARED_LINKER_FLAGS}") +endif() + mason_use(jni.hpp VERSION 2.0.0 HEADER_ONLY) mason_use(libjpeg-turbo VERSION 1.5.0) mason_use(libpng VERSION 1.6.25) @@ -173,7 +180,6 @@ macro(mbgl_platform_core) PUBLIC -latomic PUBLIC -lz PUBLIC -Wl,--gc-sections - PUBLIC -Wl,--icf=safe ) endmacro() @@ -197,7 +203,6 @@ target_compile_options(mapbox-gl target_link_libraries(mapbox-gl PUBLIC mbgl-core PUBLIC -Wl,--gc-sections - PUBLIC -Wl,--icf=safe ) # Create a stripped version of the library and copy it to the JNIDIR. @@ -284,7 +289,6 @@ target_compile_options(example-custom-layer target_link_libraries(example-custom-layer PRIVATE mapbox-gl PUBLIC -Wl,--gc-sections - PUBLIC -Wl,--icf=safe ) add_custom_command(TARGET example-custom-layer POST_BUILD -- cgit v1.2.1