aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@digia.com>2013-10-30 15:35:54 +0100
committerChristian Kandeler <christian.kandeler@digia.com>2013-10-31 11:28:43 +0100
commitbc96c68b71e29aa824f9f967cda68e8b29f0214d (patch)
treef15e87eba8850e3ba1acd0642c569f930c062665
parent420595bc0753d67460bf672207113337f50d9403 (diff)
Separate between overridden values and others in command-line frontend.
The current code is too simplistic in that it just pretends the whole configuration was explicitly set on the command line. This can lead to precedence problems regarding module properties set in project files and profiles. Change-Id: I50113486159308a9660be7b86d2e2240527df73e Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
-rw-r--r--src/app/qbs/commandlinefrontend.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/app/qbs/commandlinefrontend.cpp b/src/app/qbs/commandlinefrontend.cpp
index bc9b9762e..001754615 100644
--- a/src/app/qbs/commandlinefrontend.cpp
+++ b/src/app/qbs/commandlinefrontend.cpp
@@ -130,8 +130,17 @@ void CommandLineFrontend::start()
if (!m_parser.buildBeforeInstalling())
params.setRestoreBehavior(SetupProjectParameters::RestoreOnly);
foreach (const QVariantMap &buildConfig, m_parser.buildConfigurations()) {
- params.setOverriddenValues(buildConfig);
- params.setBuildConfiguration(buildConfig);
+ QVariantMap baseConfig;
+ QVariantMap userConfig = buildConfig;
+ QString buildVariantKey = QLatin1String("qbs.buildVariant");
+ baseConfig.insert(buildVariantKey, userConfig.take(buildVariantKey));
+ const QVariantMap::Iterator it = userConfig.find(QLatin1String("qbs.profile"));
+ if (it != userConfig.end()) {
+ baseConfig.insert(it.key(), it.value());
+ userConfig.erase(it);
+ }
+ params.setBuildConfiguration(baseConfig);
+ params.setOverriddenValues(userConfig);
const ErrorInfo err = params.expandBuildConfiguration(m_settings);
if (err.hasError())
throw err;