From 7cbe1ca33da54cf2b6c8494bad39b6570f798014 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 22 Aug 2019 11:09:45 +0200 Subject: [PATCH] CMake: Fix detection of debug_and_release for Windows builds If Qt is configured with -release or -debug we must set CMAKE_DEBUG_TYPE or CMAKE_RELEASE_TYPE, but not both. This was broken by 82a2c7df which fixed the issue for iOS simulator_and_device builds. We have the following situation for both relevant CONFIG values: debug_and_release build_all iOS simulator_and_device unset set Windows -release set unset Windows -debug-and-release set set Trivia: On Windows, when configuring with -release (or -debug) then the *feature* debug_and_release is not set. The *CONFIG* *value* however, is unconditionally set in msvc-desktop.conf. Fixes: QTBUG-77754 Change-Id: I326ecb024056bc189be5fa03ec6f59bc71226544 Reviewed-by: Alexandru Croitor --- mkspecs/features/create_cmake.prf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf index 65c637244b..8100128441 100644 --- a/mkspecs/features/create_cmake.prf +++ b/mkspecs/features/create_cmake.prf @@ -138,8 +138,8 @@ CMAKE_RELEASE_TYPE = # the debug libraries at build time. equals(QMAKE_HOST.os, Windows): CMAKE_BIN_SUFFIX = ".exe" -debug_and_release|CONFIG(debug, debug|release): CMAKE_DEBUG_TYPE = debug -debug_and_release|CONFIG(release, debug|release): CMAKE_RELEASE_TYPE = release +if(debug_and_release:build_all)|CONFIG(debug, debug|release): CMAKE_DEBUG_TYPE = debug +if(debug_and_release:build_all)|CONFIG(release, debug|release): CMAKE_RELEASE_TYPE = release # CMAKE_DEBUG_AND_RELEASE is used to tell the _populate_$${CMAKE_MODULE_NAME}_target_properties # functions whether a Configuration specific generator expression needs to be added to the values