summaryrefslogtreecommitdiffstats
path: root/Modules/Platform/Android
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
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')
-rw-r--r--Modules/Platform/Android/Determine-Compiler.cmake10
1 files changed, 10 insertions, 0 deletions
diff --git a/Modules/Platform/Android/Determine-Compiler.cmake b/Modules/Platform/Android/Determine-Compiler.cmake
index 5c6b97b..f9c2d89 100644
--- a/Modules/Platform/Android/Determine-Compiler.cmake
+++ b/Modules/Platform/Android/Determine-Compiler.cmake
@@ -31,6 +31,16 @@ elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
set(_ANDROID_HOST_EXT "")
elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
set(_ANDROID_HOST_EXT ".exe")
+elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Android")
+ # Natively compiling on an Android host doesn't use the NDK cross-compilation
+ # tools.
+ macro(__android_determine_compiler lang)
+ # Do nothing
+ endmacro()
+ if(NOT CMAKE_CXX_COMPILER_NAMES)
+ set(CMAKE_CXX_COMPILER_NAMES c++)
+ endif()
+ return()
else()
message(FATAL_ERROR "Android: Builds hosted on '${CMAKE_HOST_SYSTEM_NAME}' not supported.")
endif()