aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2021-07-21 15:24:15 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2021-07-22 07:29:15 +0000
commit2e2e75a58940bfd0721637b9e428c4fdce7d26ed (patch)
treef0e81f9426fdf7dd2b44003e707d8529e0fba194 /src
parent832f2e94d3e780e1c990c66a59df18403f060ba7 (diff)
Give more details on a property values mismatch
The user might not remember which properties were originally passed on the command line, so show them if they don't match the new ones. Change-Id: I41fbfc84832c0bf56a950a6b546bccca50c88564 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/lib/corelib/buildgraph/buildgraphloader.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/lib/corelib/buildgraph/buildgraphloader.cpp b/src/lib/corelib/buildgraph/buildgraphloader.cpp
index 58a34b616..c5a377550 100644
--- a/src/lib/corelib/buildgraph/buildgraphloader.cpp
+++ b/src/lib/corelib/buildgraph/buildgraphloader.cpp
@@ -58,6 +58,7 @@
#include <logging/translator.h>
#include <tools/buildgraphlocker.h>
#include <tools/fileinfo.h>
+#include <tools/jsliterals.h>
#include <tools/persistence.h>
#include <tools/profile.h>
#include <tools/profiling.h>
@@ -868,9 +869,23 @@ bool BuildGraphLoader::checkConfigCompatibility()
if (!m_parameters.overrideBuildGraphData()) {
if (!m_parameters.overriddenValues().empty()
&& m_parameters.overriddenValues() != restoredProject->overriddenValues) {
+ const auto toUserOutput = [](const QVariantMap &propMap) {
+ QString o;
+ for (auto it = propMap.begin(); it != propMap.end(); ++it) {
+ if (!o.isEmpty())
+ o += QLatin1Char(' ');
+ o.append(it.key()).append(QLatin1Char(':')).append(toJSLiteral(it.value()));
+ }
+ return o;
+ };
throw ErrorInfo(Tr::tr("Property values set on the command line differ from the "
- "ones used for the previous build. Use the 'resolve' command if "
- "you really want to rebuild with the new properties."));
+ "ones used for the previous build.\n"
+ "Old property values: %1\n"
+ "New property values: %2\n"
+ "Use the 'resolve' command if "
+ "you really want to rebuild with the new properties.")
+ .arg(toUserOutput(restoredProject->overriddenValues))
+ .arg(toUserOutput(m_parameters.overriddenValues())));
}
m_parameters.setOverriddenValues(restoredProject->overriddenValues);
if (m_parameters.topLevelProfile() != restoredProject->profile()) {