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 <alexandru.croitor@qt.io>
bb10
Joerg Bornemann 2019-08-22 11:09:45 +02:00 committed by Jörg Bornemann
parent fd785c3899
commit 7cbe1ca33d
1 changed files with 2 additions and 2 deletions

View File

@ -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