diff options
-rw-r--r-- | Modules/Platform/Android/abi-common.cmake | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/Platform/Android/abi-common.cmake b/Modules/Platform/Android/abi-common.cmake index 533bd90..3b0eb01 100644 --- a/Modules/Platform/Android/abi-common.cmake +++ b/Modules/Platform/Android/abi-common.cmake @@ -8,6 +8,10 @@ if(NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE set(CMAKE_POSITION_INDEPENDENT_CODE ON) endif() +if(CMAKE_POSITION_INDEPENDENT_CODE) + string(APPEND _ANDROID_ABI_INIT_EXE_LDFLAGS " -fPIE -pie") +endif() + string(APPEND _ANDROID_ABI_INIT_EXE_LDFLAGS " -Wl,--gc-sections") if(NOT _ANDROID_ABI_INIT_EXE_LDFLAGS_NO_nocopyreloc) |