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>
This commit is contained in:
parent
8e7dc25380
commit
eea1c359c9
@ -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()
|
QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateConfigFeatures()
|
||||||
{
|
{
|
||||||
QSet<QString> processed;
|
QSet<QString> processed;
|
||||||
@ -1377,14 +1385,19 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProFile(
|
|||||||
it != m_extraVars.constEnd(); ++it)
|
it != m_extraVars.constEnd(); ++it)
|
||||||
m_valuemapStack.first().insert(it.key(), it.value());
|
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)
|
if ((vr = evaluateFeatureFile(QLatin1String("default_pre.prf"))) == ReturnError)
|
||||||
goto failed;
|
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
|
// Again, after user configs, to override them
|
||||||
if (!m_extraConfigs.isEmpty())
|
applyExtraConfigs();
|
||||||
evaluateCommand(fL1S("CONFIG += ") + m_extraConfigs.join(QLatin1Char(' ')), fL1S("(extra configs)"));
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
debugMsg(1, "visiting file %s", qPrintable(pro->fileName()));
|
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.
|
// Again, to ensure the project does not mess with us.
|
||||||
// Specifically, do not allow a project to override debug/release within a
|
// 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.
|
// debug_and_release build pass - it's too late for that at this point anyway.
|
||||||
if (!m_extraConfigs.isEmpty())
|
applyExtraConfigs();
|
||||||
evaluateCommand(fL1S("CONFIG += ") + m_extraConfigs.join(QLatin1Char(' ')), fL1S("(extra configs)"));
|
|
||||||
|
|
||||||
if ((vr = evaluateFeatureFile(QLatin1String("default_post.prf"))) == ReturnError)
|
if ((vr = evaluateFeatureFile(QLatin1String("default_post.prf"))) == ReturnError)
|
||||||
goto failed;
|
goto failed;
|
||||||
|
@ -170,6 +170,7 @@ public:
|
|||||||
void initFrom(const QMakeEvaluator &other);
|
void initFrom(const QMakeEvaluator &other);
|
||||||
void setupProject();
|
void setupProject();
|
||||||
void evaluateCommand(const QString &cmds, const QString &where);
|
void evaluateCommand(const QString &cmds, const QString &where);
|
||||||
|
void applyExtraConfigs();
|
||||||
VisitReturn visitProFile(ProFile *pro, QMakeHandler::EvalFileType type,
|
VisitReturn visitProFile(ProFile *pro, QMakeHandler::EvalFileType type,
|
||||||
LoadFlags flags);
|
LoadFlags flags);
|
||||||
VisitReturn visitProBlock(ProFile *pro, const ushort *tokPtr);
|
VisitReturn visitProBlock(ProFile *pro, const ushort *tokPtr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user