summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@digia.com>2013-10-08 23:44:24 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-11 18:47:27 +0200
commiteea1c359c9663cec15e7373c065ee06cba151eed (patch)
tree1701f9cc00e182f86b5a5bfd0019d9d7af25b8ee
parent8e7dc25380dceebca094e092d9feb21ad167ba91 (diff)
qmake: Evaluate extra configs before loading default_pre
Exclusive builds uses setExtraConfigs to apply the particular CONFIG of each build pass. Unfortunately we were not applying these extra configs early enough in QMakeEvaluator::visitProFile() for them to be picked up/usable by default_pre, something that can be useful. Change-Id: I423a4688250a15f0c1a2cc65a48f0bbc14ad4497 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
-rw-r--r--qmake/library/qmakeevaluator.cpp24
-rw-r--r--qmake/library/qmakeevaluator.h1
2 files changed, 19 insertions, 6 deletions
diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp
index c4b8c150e7..9a2bcd7680 100644
--- a/qmake/library/qmakeevaluator.cpp
+++ b/qmake/library/qmakeevaluator.cpp
@@ -1271,6 +1271,14 @@ void QMakeEvaluator::evaluateCommand(const QString &cmds, const QString &where)
}
}
+void QMakeEvaluator::applyExtraConfigs()
+{
+ if (m_extraConfigs.isEmpty())
+ return;
+
+ evaluateCommand(fL1S("CONFIG += ") + m_extraConfigs.join(QLatin1Char(' ')), fL1S("(extra configs)"));
+}
+
QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateConfigFeatures()
{
QSet<QString> processed;
@@ -1377,14 +1385,19 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProFile(
it != m_extraVars.constEnd(); ++it)
m_valuemapStack.first().insert(it.key(), it.value());
+ // In case default_pre needs to make decisions based on the current
+ // build pass configuration.
+ applyExtraConfigs();
+
if ((vr = evaluateFeatureFile(QLatin1String("default_pre.prf"))) == ReturnError)
goto failed;
- evaluateCommand(m_option->precmds, fL1S("(command line)"));
+ if (!m_option->precmds.isEmpty()) {
+ evaluateCommand(m_option->precmds, fL1S("(command line)"));
- // After user configs, to override them
- if (!m_extraConfigs.isEmpty())
- evaluateCommand(fL1S("CONFIG += ") + m_extraConfigs.join(QLatin1Char(' ')), fL1S("(extra configs)"));
+ // Again, after user configs, to override them
+ applyExtraConfigs();
+ }
}
debugMsg(1, "visiting file %s", qPrintable(pro->fileName()));
@@ -1398,8 +1411,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProFile(
// Again, to ensure the project does not mess with us.
// Specifically, do not allow a project to override debug/release within a
// debug_and_release build pass - it's too late for that at this point anyway.
- if (!m_extraConfigs.isEmpty())
- evaluateCommand(fL1S("CONFIG += ") + m_extraConfigs.join(QLatin1Char(' ')), fL1S("(extra configs)"));
+ applyExtraConfigs();
if ((vr = evaluateFeatureFile(QLatin1String("default_post.prf"))) == ReturnError)
goto failed;
diff --git a/qmake/library/qmakeevaluator.h b/qmake/library/qmakeevaluator.h
index 8ca2b182c7..c1e7037762 100644
--- a/qmake/library/qmakeevaluator.h
+++ b/qmake/library/qmakeevaluator.h
@@ -170,6 +170,7 @@ public:
void initFrom(const QMakeEvaluator &other);
void setupProject();
void evaluateCommand(const QString &cmds, const QString &where);
+ void applyExtraConfigs();
VisitReturn visitProFile(ProFile *pro, QMakeHandler::EvalFileType type,
LoadFlags flags);
VisitReturn visitProBlock(ProFile *pro, const ushort *tokPtr);