From 4306fc019ad88b124cd1af0998a3bcc60856fc74 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 21 Aug 2020 15:16:31 +0200 Subject: [PATCH] CMake: Fix detection of the 'debug' feature The debug feature for the CMake build is solely determined by the value of CMAKE_BUILD_TYPE or CMAKE_CONFIGURATION_TYPES. There is no point in restricting the autoDetect expression to developer builds or MSVC and macOS builds. User-visible result: -DCMAKE_BUILD_TYPE=Debug now actually turns the 'debug' feature on, also for non-developer builds on Linux. Change-Id: I65c92575c9483bff16beb78b60606c55aeadcece Reviewed-by: Alexandru Croitor --- configure.cmake | 2 +- util/cmake/configurejson2cmake.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.cmake b/configure.cmake index e4b632f0db9..a45c8431d2a 100644 --- a/configure.cmake +++ b/configure.cmake @@ -452,7 +452,7 @@ qt_feature_config("developer-build" QMAKE_PUBLIC_QT_CONFIG ) qt_feature("debug" LABEL "Build for debugging" - AUTODETECT QT_FEATURE_developer_build OR ( WIN32 AND NOT GCC ) OR APPLE + AUTODETECT ON CONDITION CMAKE_BUILD_TYPE STREQUAL Debug OR Debug IN_LIST CMAKE_CONFIGURATION_TYPES ) qt_feature("debug_and_release" PUBLIC diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 8b74cf53cb4..7fa19166d59 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -893,6 +893,7 @@ def get_feature_mapping(): "condition": "QT_GENERATOR_IS_MULTI_CONFIG", }, "debug": { + "autoDetect": "ON", "condition": "CMAKE_BUILD_TYPE STREQUAL Debug OR Debug IN_LIST CMAKE_CONFIGURATION_TYPES" }, "dlopen": {"condition": "UNIX"},