summaryrefslogtreecommitdiff
path: root/Modules/Platform/Android/abi-common.cmake
blob: a0b47f4e683680d62b121dcb37d1cf984bd822f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
string(APPEND _ANDROID_ABI_INIT_CFLAGS
  " -funwind-tables"
  " -no-canonical-prefixes"
  )

if(CMAKE_ANDROID_NDK AND NOT CMAKE_ANDROID_NDK_DEPRECATED_HEADERS)
  string(APPEND _ANDROID_ABI_INIT_CFLAGS " -D__ANDROID_API__=${CMAKE_SYSTEM_VERSION}")
endif()

if(NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE
    AND NOT CMAKE_SYSTEM_VERSION VERSION_LESS 16)
  set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()

string(APPEND _ANDROID_ABI_INIT_EXE_LDFLAGS " -Wl,--gc-sections")

if(NOT _ANDROID_ABI_INIT_EXE_LDFLAGS_NO_nocopyreloc)
  string(APPEND _ANDROID_ABI_INIT_EXE_LDFLAGS " -Wl,-z,nocopyreloc")
endif()