summaryrefslogtreecommitdiffstats
path: root/mkspecs
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-08-23 10:41:17 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-08-25 16:47:25 +0200
commit6a859f8112e33c1373b6b6899475ee79b3ba3137 (patch)
tree1bb6ce63180be524746336fed0efaef7a6c1bd50 /mkspecs
parent7cbe1ca33da54cf2b6c8494bad39b6570f798014 (diff)
CMake: Fix usage of non debug and release static builds on Windows
As was recently discovered, the debug_and_release CONFIG value is always true on Windows, even if the feaure is disabled when specifying -debug or -release when configuring Qt. In order for the generated CMake Config files to be correct, we need to use the true feature value. Amends 44602224bfae7bea08e5883768cfeef6629ac503. Change-Id: I42be684e8ad2a5ce72cb2e9d36f81de7589112c6 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'mkspecs')
-rw-r--r--mkspecs/features/create_cmake.prf9
1 files changed, 8 insertions, 1 deletions
diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf
index 8100128441..5c561042cd 100644
--- a/mkspecs/features/create_cmake.prf
+++ b/mkspecs/features/create_cmake.prf
@@ -153,7 +153,14 @@ if(debug_and_release:build_all)|CONFIG(release, debug|release): CMAKE_RELEASE_TY
# <CONFIG> equivalent to the value specified by CMAKE_BUILD_TYPE.
# This means that when Qt was built in a Release configuration, and the application in a Debug
# configuration, IMPORTED_LOCATION_RELEASE will be used for the Qt libraries.
-debug_and_release {
+#
+# Note that we need to check for the "debug_and_release" feature, and not the CONFIG value, because
+# the CONFIG value is always set to true on Windows in msvc-desktop.conf disregarding whether the
+# configure line specified just -debug or just -release.
+# This also means that if a user configures and builds Qt with -release, and then calls nmake debug
+# to build debug libraries of Qt, the generated CMake file won't know about debug libraries,
+# and will always link against the release libraries.
+qtConfig(debug_and_release) {
CMAKE_DEBUG_AND_RELEASE = TRUE
} else {
CMAKE_DEBUG_AND_RELEASE = FALSE