summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2019-09-03 09:09:06 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2019-09-03 08:22:03 +0000
commit0ef87537742cce5a8e7a30a9ba9b923f0f4d2dc9 (patch)
tree010a19f84ab7cae896c0408bdb264c244a79b176 /cmake
parent3ff31ed020a38a2975e99a44303a70994f3c60f4 (diff)
Prospective fix for linking problems of qtdeclarative in the CI
In the ICC configuration we can't build the qtbase libraries with ICC and qtdeclarative with gcc, mixing won't work well. On Windows we've covered this compiler mixing scenario using our toolchain file, but the ICC case makes it clear that we have to be consistent about caching the compiler in the toolchain file across platforms. Change-Id: Iad2005ab00655f902e5f5cea2f0563d790d8aa93 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtBaseGlobalTargets.cmake10
1 files changed, 5 insertions, 5 deletions
diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake
index ecfb4429d2..df3ceb88c0 100644
--- a/cmake/QtBaseGlobalTargets.cmake
+++ b/cmake/QtBaseGlobalTargets.cmake
@@ -85,6 +85,11 @@ if(VCPKG_TARGET_TRIPLET)
list(APPEND init_vcpkg "set(VCPKG_TARGET_TRIPLET \"${VCPKG_TARGET_TRIPLET}\" CACHE STRING \"\")")
endif()
+# On Windows compilers aren't easily mixed. Avoid that qtbase is built using cl.exe for example and then for another
+# build gcc is picked up from %PATH%. The same goes when using a custom compiler on other platforms, such as ICC.
+list(APPEND init_platform "set(CMAKE_CXX_COMPILER \"${CMAKE_CXX_COMPILER}\" CACHE STRING \"\")")
+list(APPEND init_platform "set(CMAKE_C_COMPILER \"${CMAKE_C_COMPILER}\" CACHE STRING \"\")")
+
if(APPLE)
if(CMAKE_OSX_SYSROOT)
list(APPEND init_platform "set(CMAKE_OSX_SYSROOT \"${CMAKE_OSX_SYSROOT}\" CACHE PATH \"\")")
@@ -92,11 +97,6 @@ if(APPLE)
if(CMAKE_OSX_DEPLOYMENT_TARGET)
list(APPEND init_platform "set(CMAKE_OSX_DEPLOYMENT_TARGET \"${CMAKE_OSX_DEPLOYMENT_TARGET}\" CACHE STRING \"\")")
endif()
-elseif(WIN32)
- # On Windows compilers aren't easily mixed. Avoid that qtbase is built using cl.exe for example and then for another
- # build gcc is picked up from %PATH%.
- list(APPEND init_platform "set(CMAKE_CXX_COMPILER \"${CMAKE_CXX_COMPILER}\" CACHE STRING \"\")")
- list(APPEND init_platform "set(CMAKE_C_COMPILER \"${CMAKE_C_COMPILER}\" CACHE STRING \"\")")
elseif(ANDROID)
list(APPEND init_platform "set(ANDROID_NATIVE_API_LEVEL \"${ANDROID_NATIVE_API_LEVEL}\" CACHE STRING \"\")")
list(APPEND init_platform "set(ANDROID_STL \"${ANDROID_STL}\" CACHE STRING \"\")")