diff options
author | Butta <gl@butta.fastem.com> | 2019-10-15 07:54:02 (GMT) |
---|---|---|
committer | Butta <gl@butta.fastem.com> | 2019-10-15 15:43:51 (GMT) |
commit | c5892e484e21f49abf2afd138dddd6720bf91adc (patch) | |
tree | 71895167fb4b068785a68f06c0a5ca339df57eca /Source/cmStateSnapshot.cxx | |
parent | daf6a6ba68a6fa1c5d1956f151104d903f3447cc (diff) | |
download | CMake-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 'Source/cmStateSnapshot.cxx')
-rw-r--r-- | Source/cmStateSnapshot.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx index 645907c..832e74e 100644 --- a/Source/cmStateSnapshot.cxx +++ b/Source/cmStateSnapshot.cxx @@ -315,10 +315,14 @@ void cmStateSnapshot::SetDefaultDefinitions() this->SetDefinition("UNIX", "1"); this->SetDefinition("CMAKE_HOST_UNIX", "1"); +# if defined(__ANDROID__) + this->SetDefinition("CMAKE_HOST_SYSTEM_NAME", "Android"); +# else struct utsname uts_name; if (uname(&uts_name) >= 0) { this->SetDefinition("CMAKE_HOST_SYSTEM_NAME", uts_name.sysname); } +# endif #endif #if defined(__CYGWIN__) std::string legacy; |