From e04c7270435edd04779c612bad62534cb18c518a Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Tue, 4 Jun 2024 23:18:22 +0200 Subject: [PATCH] CMakePM: Don't remove QML debugging flag with the preset value If a CMake preset has the CMAKE_CXX_FLAGS_INIT parameter defined, it would override the QML debugging flag set before. This patchset makes sure that both are present. Change-Id: I2012567af04c2fa0b0097331c05d96770dd86503 Reviewed-by: Alessandro Portale --- .../cmakeprojectmanager/cmakebuildconfiguration.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index e727fc68f88..92746dce305 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -1349,6 +1349,14 @@ static void addCMakeConfigurePresetToInitialArguments(QStringList &initialArgume if (argFilePath != presetFilePath) arg = presetItem.toArgument(); + } else if (argItem.key == "CMAKE_CXX_FLAGS_INIT") { + // Append the preset value with at the initial parameters value (e.g. QML Debugging) + if (argItem.expandedValue(k) != QString::fromUtf8(presetItem.value)) { + argItem.value.append(" "); + argItem.value.append(presetItem.value); + + arg = argItem.toArgument(); + } } else if (argItem.expandedValue(k) != QString::fromUtf8(presetItem.value)) { arg = presetItem.toArgument(); }