summaryrefslogtreecommitdiffstats
path: root/Modules/Platform/Android/abi-common.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/Platform/Android/abi-common.cmake')
-rw-r--r--Modules/Platform/Android/abi-common.cmake4
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/Platform/Android/abi-common.cmake b/Modules/Platform/Android/abi-common.cmake
index 3b0eb01..10fb897 100644
--- a/Modules/Platform/Android/abi-common.cmake
+++ b/Modules/Platform/Android/abi-common.cmake
@@ -3,6 +3,10 @@ string(APPEND _ANDROID_ABI_INIT_CFLAGS
" -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)