cmake: remove unneeded Android patches and disable GHS generator

This commit is contained in:
Butta 2020-03-25 00:58:36 +05:30 committed by Leonid Pliushch
parent a1e1440c9d
commit 3124a2e648
6 changed files with 22 additions and 74 deletions

View File

@ -1,17 +0,0 @@
diff --git a/Modules/Platform/Android-Clang.cmake b/Modules/Platform/Android-Clang.cmake
index 9ed1e01f9..6443512ee 100644
--- a/Modules/Platform/Android-Clang.cmake
+++ b/Modules/Platform/Android-Clang.cmake
@@ -24,6 +24,12 @@ if(CMAKE_SYSTEM_VERSION EQUAL 1)
return()
endif()
+if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Android")
+ macro(__android_compiler_clang lang)
+ endmacro()
+ return()
+endif()
+
include(Platform/Android-Common)
# The NDK toolchain configuration files at:

View File

@ -1,15 +0,0 @@
diff --git a/Modules/Platform/Android-Determine.cmake b/Modules/Platform/Android-Determine.cmake
index bb42eedde..0e8229d5e 100644
--- a/Modules/Platform/Android-Determine.cmake
+++ b/Modules/Platform/Android-Determine.cmake
@@ -18,6 +18,10 @@ if(CMAKE_SYSTEM_VERSION EQUAL 1)
return()
endif()
+if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Android")
+ return()
+endif()
+
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST

View File

@ -1,15 +0,0 @@
diff --git a/Modules/Platform/Android-Initialize.cmake b/Modules/Platform/Android-Initialize.cmake
index a434f90ea..407ed3358 100644
--- a/Modules/Platform/Android-Initialize.cmake
+++ b/Modules/Platform/Android-Initialize.cmake
@@ -17,6 +17,10 @@ if(CMAKE_SYSTEM_VERSION EQUAL 1)
return()
endif()
+if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Android")
+ return()
+endif()
+
if(NOT CMAKE_SYSROOT)
if(CMAKE_ANDROID_NDK)
set(CMAKE_SYSROOT "${CMAKE_ANDROID_NDK}/platforms/android-${CMAKE_SYSTEM_VERSION}/arch-${CMAKE_ANDROID_ARCH}")

View File

@ -1,15 +0,0 @@
diff --git a/Modules/Platform/Android.cmake b/Modules/Platform/Android.cmake
index f08f84176..9e719df39 100644
--- a/Modules/Platform/Android.cmake
+++ b/Modules/Platform/Android.cmake
@@ -2,6 +2,10 @@ include(Platform/Linux)
set(ANDROID 1)
+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)

View File

@ -1,12 +0,0 @@
diff -u -r ../cmake-3.15.2/Source/CMakeLists.txt ./Source/CMakeLists.txt
--- ../cmake-3.15.2/Source/CMakeLists.txt 2019-08-07 16:58:29.000000000 +0000
+++ ./Source/CMakeLists.txt 2019-08-21 10:42:07.237355685 +0000
@@ -759,7 +759,7 @@
# GHS support
# Works only for windows and linux
-if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "Linux")
+if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android")
set(SRCS ${SRCS}
cmGlobalGhsMultiGenerator.cxx
cmGlobalGhsMultiGenerator.h

View File

@ -0,0 +1,22 @@
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index a99d9a633..55ae9d254 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -109,7 +109,7 @@
# include "cmExtraEclipseCDT4Generator.h"
#endif
-#if defined(__linux__) || defined(_WIN32)
+#if (defined(__linux__) && !defined(__ANDROID__)) || defined(_WIN32)
# include "cmGlobalGhsMultiGenerator.h"
#endif
@@ -1982,7 +1982,7 @@ void cmake::AddDefaultGenerators()
#endif
this->Generators.push_back(cmGlobalUnixMakefileGenerator3::NewFactory());
#if !defined(CMAKE_BOOTSTRAP)
-# if defined(__linux__) || defined(_WIN32)
+# if (defined(__linux__) && !defined(__ANDROID__)) || defined(_WIN32)
this->Generators.push_back(cmGlobalGhsMultiGenerator::NewFactory());
# endif
this->Generators.push_back(cmGlobalNinjaGenerator::NewFactory());