summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-11-13 16:47:28 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-11-16 12:36:33 +0100
commit125113c9099e04efdbef7939c3976ee5e2c0ba29 (patch)
tree16d9ac18ee6a612908c46199ed3fcd5840e67262 /cmake
parentcd1075459cf3a5fd864b745b0492ef4b5e10d572 (diff)
CMake: Fix configure not to pass clang compilers for Android
That breaks configuration with CMake version 3.18.x (but not 3.19 for some reason). Specifically configure ends up passing -DCMAKE_CXX_COMPILER=clang++ which overrides the compiler set by the CMake Android toolchain file, and at the very end of CMake's configuration it complains about You have changed variables that require your cache to be deleted. Configure will be re-run and you may have to reset some variables. The following variables have changed: CMAKE_CXX_COMPILER= clang++ Which suddenly starts another configuration with the modified compilers, ends up detecting host compilers and libraries and basically everything breaks apart. Fix QtProcessConfigureArgs.cmake not to pass the compiler options if the mkspec contains 'android'. Who knows, we might need this for other platforms too at some point. Task-number: QTBUG-88460 Change-Id: Idd57870a7cb1009a4e7802e5b3d5ac735f2dacf6 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtProcessConfigureArgs.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmake/QtProcessConfigureArgs.cmake b/cmake/QtProcessConfigureArgs.cmake
index b4494c8645..e8672306dd 100644
--- a/cmake/QtProcessConfigureArgs.cmake
+++ b/cmake/QtProcessConfigureArgs.cmake
@@ -593,7 +593,7 @@ function(guess_compiler_from_mkspec)
endif()
string(REGEX MATCH "(^|;)-DQT_QMAKE_TARGET_MKSPEC=\([^;]+\)" m "${cmake_args}")
set(mkspec ${CMAKE_MATCH_2})
- if(mkspec MATCHES "-clang(-|$)")
+ if(mkspec MATCHES "-clang(-|$)" AND NOT mkspec MATCHES "android")
push("-DCMAKE_C_COMPILER=clang")
push("-DCMAKE_CXX_COMPILER=clang++")
elseif(mkspec MATCHES "-icc(-|$)")