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 <christian.kandeler@qt.io>
This commit is contained in:
hjk
2019-12-04 15:33:07 +01:00
parent a07053853b
commit 24f7c2b8fa
2 changed files with 28 additions and 7 deletions

View File

@@ -44,6 +44,7 @@
#include <projectexplorer/buildaspects.h> #include <projectexplorer/buildaspects.h>
#include <projectexplorer/buildinfo.h> #include <projectexplorer/buildinfo.h>
#include <projectexplorer/buildmanager.h> #include <projectexplorer/buildmanager.h>
#include <projectexplorer/buildpropertiessettings.h>
#include <projectexplorer/buildsteplist.h> #include <projectexplorer/buildsteplist.h>
#include <projectexplorer/kit.h> #include <projectexplorer/kit.h>
#include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorer.h>
@@ -73,6 +74,14 @@ using namespace QmakeProjectManager::Internal;
namespace QmakeProjectManager { namespace QmakeProjectManager {
QmakeExtraBuildInfo::QmakeExtraBuildInfo()
{
const BuildPropertiesSettings &settings = ProjectExplorerPlugin::buildPropertiesSettings();
config.separateDebugInfo = settings.separateDebugInfo;
config.linkQmlDebuggingQQ2 = settings.qmlDebugging;
config.useQtQuickCompiler = settings.qtQuickCompiler;
}
// -------------------------------------------------------------------- // --------------------------------------------------------------------
// Helpers: // Helpers:
// -------------------------------------------------------------------- // --------------------------------------------------------------------
@@ -717,17 +726,21 @@ BuildInfo QmakeBuildConfigurationFactory::createBuildInfo(const Kit *k,
const FilePath &projectPath, const FilePath &projectPath,
BuildConfiguration::BuildType type) const BuildConfiguration::BuildType type) const
{ {
const BuildPropertiesSettings &settings = ProjectExplorerPlugin::buildPropertiesSettings();
BaseQtVersion *version = QtKitAspect::qtVersion(k); BaseQtVersion *version = QtKitAspect::qtVersion(k);
QmakeExtraBuildInfo extraInfo; QmakeExtraBuildInfo extraInfo;
BuildInfo info(this); BuildInfo info(this);
QString suffix; QString suffix;
if (type == BuildConfiguration::Release) { if (type == BuildConfiguration::Release) {
//: The name of the release build configuration created by default for a qmake project. //: The name of the release build configuration created by default for a qmake project.
info.displayName = tr("Release"); info.displayName = tr("Release");
//: Non-ASCII characters in directory suffix may cause build issues. //: Non-ASCII characters in directory suffix may cause build issues.
suffix = tr("Release", "Shadow build directory suffix"); suffix = tr("Release", "Shadow build directory suffix");
if (version && version->isQtQuickCompilerSupported()) if (settings.qtQuickCompiler == TriState::Default) {
extraInfo.config.useQtQuickCompiler = TriState::Enabled; if (version && version->isQtQuickCompilerSupported())
extraInfo.config.useQtQuickCompiler = TriState::Enabled;
}
} else { } else {
if (type == BuildConfiguration::Debug) { if (type == BuildConfiguration::Debug) {
//: The name of the debug build configuration created by default for a qmake project. //: 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"); info.displayName = tr("Profile");
//: Non-ASCII characters in directory suffix may cause build issues. //: Non-ASCII characters in directory suffix may cause build issues.
suffix = tr("Profile", "Shadow build directory suffix"); suffix = tr("Profile", "Shadow build directory suffix");
extraInfo.config.separateDebugInfo = TriState::Enabled; if (settings.separateDebugInfo == TriState::Default)
if (version && version->isQtQuickCompilerSupported()) extraInfo.config.separateDebugInfo = TriState::Enabled;
extraInfo.config.useQtQuickCompiler = 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; info.typeName = info.displayName;
// Leave info.buildDirectory unset; // Leave info.buildDirectory unset;

View File

@@ -32,6 +32,8 @@ namespace QmakeProjectManager {
class QmakeExtraBuildInfo final class QmakeExtraBuildInfo final
{ {
public: public:
QmakeExtraBuildInfo();
QString additionalArguments; QString additionalArguments;
QString makefile; QString makefile;
QMakeStepConfig config; QMakeStepConfig config;