From 24f7c2b8faa497694498c716d27d931e94148277 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 4 Dec 2019 15:33:07 +0100 Subject: [PATCH] Qmake: Accept global build settings as authorative ... when initializing build configuration. Potential re-alignment with contents of pre-existing Makefiles is confusing at best, and depends on the presence of Makefiles that are typically close to invisble when using an IDE. Change-Id: Iadbab4f32badfbf948cfa2a1b256932acbfe858f Reviewed-by: Christian Kandeler --- .../qmakebuildconfiguration.cpp | 33 +++++++++++++++---- .../qmakeprojectmanager/qmakebuildinfo.h | 2 ++ 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp index 0e20d1920b2..f2647949196 100644 --- a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp +++ b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -73,6 +74,14 @@ using namespace QmakeProjectManager::Internal; namespace QmakeProjectManager { +QmakeExtraBuildInfo::QmakeExtraBuildInfo() +{ + const BuildPropertiesSettings &settings = ProjectExplorerPlugin::buildPropertiesSettings(); + config.separateDebugInfo = settings.separateDebugInfo; + config.linkQmlDebuggingQQ2 = settings.qmlDebugging; + config.useQtQuickCompiler = settings.qtQuickCompiler; +} + // -------------------------------------------------------------------- // Helpers: // -------------------------------------------------------------------- @@ -717,17 +726,21 @@ BuildInfo QmakeBuildConfigurationFactory::createBuildInfo(const Kit *k, const FilePath &projectPath, BuildConfiguration::BuildType type) const { + const BuildPropertiesSettings &settings = ProjectExplorerPlugin::buildPropertiesSettings(); BaseQtVersion *version = QtKitAspect::qtVersion(k); QmakeExtraBuildInfo extraInfo; BuildInfo info(this); QString suffix; + if (type == BuildConfiguration::Release) { //: The name of the release build configuration created by default for a qmake project. info.displayName = tr("Release"); //: Non-ASCII characters in directory suffix may cause build issues. suffix = tr("Release", "Shadow build directory suffix"); - if (version && version->isQtQuickCompilerSupported()) - extraInfo.config.useQtQuickCompiler = TriState::Enabled; + if (settings.qtQuickCompiler == TriState::Default) { + if (version && version->isQtQuickCompilerSupported()) + extraInfo.config.useQtQuickCompiler = TriState::Enabled; + } } else { if (type == BuildConfiguration::Debug) { //: The name of the debug build configuration created by default for a qmake project. @@ -739,12 +752,18 @@ BuildInfo QmakeBuildConfigurationFactory::createBuildInfo(const Kit *k, info.displayName = tr("Profile"); //: Non-ASCII characters in directory suffix may cause build issues. suffix = tr("Profile", "Shadow build directory suffix"); - extraInfo.config.separateDebugInfo = TriState::Enabled; - if (version && version->isQtQuickCompilerSupported()) - extraInfo.config.useQtQuickCompiler = TriState::Enabled; + if (settings.separateDebugInfo == TriState::Default) + extraInfo.config.separateDebugInfo = TriState::Enabled; + + if (settings.qtQuickCompiler == TriState::Default) { + if (version && version->isQtQuickCompilerSupported()) + extraInfo.config.useQtQuickCompiler = TriState::Enabled; + } + } + if (settings.qmlDebugging == TriState::Default) { + if (version && version->isQmlDebuggingSupported()) + extraInfo.config.linkQmlDebuggingQQ2 = TriState::Enabled; } - if (version && version->isQmlDebuggingSupported()) - extraInfo.config.linkQmlDebuggingQQ2 = TriState::Enabled; } info.typeName = info.displayName; // Leave info.buildDirectory unset; diff --git a/src/plugins/qmakeprojectmanager/qmakebuildinfo.h b/src/plugins/qmakeprojectmanager/qmakebuildinfo.h index 1d513f3271c..a26615e175a 100644 --- a/src/plugins/qmakeprojectmanager/qmakebuildinfo.h +++ b/src/plugins/qmakeprojectmanager/qmakebuildinfo.h @@ -32,6 +32,8 @@ namespace QmakeProjectManager { class QmakeExtraBuildInfo final { public: + QmakeExtraBuildInfo(); + QString additionalArguments; QString makefile; QMakeStepConfig config;