summaryrefslogtreecommitdiffstats
path: root/Modules/Platform/Android.cmake
diff options
context:
space:
mode:
authorButta <gl@butta.fastem.com>2019-10-15 07:54:02 (GMT)
committerButta <gl@butta.fastem.com>2019-10-15 15:43:51 (GMT)
commitc5892e484e21f49abf2afd138dddd6720bf91adc (patch)
tree71895167fb4b068785a68f06c0a5ca339df57eca /Modules/Platform/Android.cmake
parentdaf6a6ba68a6fa1c5d1956f151104d903f3447cc (diff)
downloadCMake-c5892e484e21f49abf2afd138dddd6720bf91adc.zip
CMake-c5892e484e21f49abf2afd138dddd6720bf91adc.tar.gz
CMake-c5892e484e21f49abf2afd138dddd6720bf91adc.tar.bz2
Android: add support for native compilation, such as with the Termux app
The CMake support for Android assumes cross-compilation using the NDK, so stub out that Android NDK support and use the Linux support that's already invoked. Set CMAKE_HOST_SYSTEM_NAME to "Android", rather than "Linux". Issue: #19840
Diffstat (limited to 'Modules/Platform/Android.cmake')
-rw-r--r--Modules/Platform/Android.cmake5
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/Platform/Android.cmake b/Modules/Platform/Android.cmake
index f08f841..8ffa1b2 100644
--- a/Modules/Platform/Android.cmake
+++ b/Modules/Platform/Android.cmake
@@ -2,6 +2,11 @@ include(Platform/Linux)
set(ANDROID 1)
+# Natively compiling on an Android host doesn't need these flags to be reset.
+if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Android")
+ return()
+endif()
+
# Conventionally Android does not use versioned soname
# But in modern versions it is acceptable
if(NOT DEFINED CMAKE_PLATFORM_NO_VERSIONED_SONAME)