Commit e20b41cd authored by Tor Arne Vestbø's avatar Tor Arne Vestbø Committed by Oswald Buddenhagen
Browse files

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: default avatarOswald Buddenhagen <oswald.buddenhagen@digia.com>
(cherry picked from qtbase/eea1c359c9663cec15e7373c065ee06cba151eed)
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent aa94bee7
......@@ -1264,6 +1264,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;
......@@ -1370,14 +1378,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()));
......@@ -1391,8 +1404,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;
......
......@@ -158,6 +158,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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment