From e559da3c6a11a695a0b8d285bd5494a1a4c38754 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 5 Nov 2020 11:14:17 +0100 Subject: CMake: Fix detection of the ltcg feature When checking the value of CMAKE_INTERPROCEDURAL_OPTIMIZATION_, then must be the upper case configuration name. Also, we must not unset __qt_ltcg_detected, because the feature condition evaluation happens way after the feature definition, and __qt_ltcg_detected was not available anymore there. This commit amends 96bdcdacbc0. Fixes: QTBUG-87874 Change-Id: I2b555bd1d7fbc8973e1d9493045c27d61b0d2c1b Reviewed-by: Alexandru Croitor --- util/cmake/configurejson2cmake.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'util') diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index d81121b98f..29afd777e7 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -920,14 +920,15 @@ if(CMAKE_INTERPROCEDURAL_OPTIMIZATION) set(__qt_ltcg_detected TRUE) else() foreach(config ${CMAKE_BUILD_TYPE} ${CMAKE_CONFIGURATION_TYPES}) - if(CMAKE_INTERPROCEDURAL_OPTIMIZATION_${config}) + string(TOUPPER "${config}" __qt_uc_config) + if(CMAKE_INTERPROCEDURAL_OPTIMIZATION_${__qt_uc_config}) set(__qt_ltcg_detected TRUE) break() endif() endforeach() + unset(__qt_uc_config) endif()""", - "condition": "__qt_ltcg_detected", - "cmakeEpilogue": "unset(__qt_ltcg_detected)" + "condition": "__qt_ltcg_detected" }, "msvc_mp": None, "simulator_and_device": {"condition": "UIKIT AND NOT QT_UIKIT_SDK"}, -- cgit v1.2.3