termux-packages/packages/cmake/Source-cmStateSnapshot.cxx.patch
Butta f935cc7152 cmake: switch CMAKE_HOST_SYSTEM_NAME to Android, which is used to set
CMAKE_SYSTEM_NAME by default, then disable CMake's built-in NDK support
when CMAKE_SYSTEM_NAME is set to Android.
2019-09-10 19:06:22 +03:00

21 lines
688 B
Diff

diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx
index 63bec710b..19286c50e 100644
--- a/Source/cmStateSnapshot.cxx
+++ b/Source/cmStateSnapshot.cxx
@@ -316,11 +316,15 @@ 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;
if (cmSystemTools::GetEnv("CMAKE_LEGACY_CYGWIN_WIN32", legacy) &&