Commit c4ec7942 authored by Oswald Buddenhagen's avatar Oswald Buddenhagen
Browse files

add support for extra vars and extra configs



will be needed for qmake build passes

Change-Id: I6c887abd8e9e858954ce90c60ccdd1b70b6aeee3
Reviewed-by: default avatarDaniel Teske <daniel.teske@nokia.com>
parent 5af04e6b
......@@ -1279,6 +1279,12 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProFile(
loadDefaults();
}
#ifdef QT_BUILD_QMAKE
for (ProValueMap::ConstIterator it = m_extraVars.constBegin();
it != m_extraVars.constEnd(); ++it)
m_valuemapStack[0].insert(it.key(), it.value());
#endif
m_handler->aboutToEval(currentProFile(), pro, type);
m_profileStack.push(pro);
valuesRef(ProKey("PWD")) = ProStringList(ProString(currentDirectory()));
......@@ -1288,6 +1294,12 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProFile(
evaluateFeatureFile(QLatin1String("default_pre.prf"));
evaluateCommand(m_option->precmds, fL1S("(command line)"));
#ifdef QT_BUILD_QMAKE
// After user configs, to override them
if (!m_extraConfigs.isEmpty())
evaluateCommand("CONFIG += " + m_extraConfigs.join(" "), fL1S("(extra configs)"));
#endif
}
debugMsg(1, "visiting file %s", qPrintable(pro->fileName()));
......@@ -1297,6 +1309,14 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProFile(
if (flags & LoadPostFiles) {
evaluateCommand(m_option->postcmds, fL1S("(command line -after)"));
#ifdef QT_BUILD_QMAKE
// 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("CONFIG += " + m_extraConfigs.join(" "), fL1S("(extra configs)"));
#endif
evaluateFeatureFile(QLatin1String("default_post.prf"));
QSet<QString> processed;
......
......@@ -89,6 +89,11 @@ public:
QMakeHandler *handler);
~QMakeEvaluator();
#ifdef QT_BUILD_QMAKE
void setExtraVars(const ProValueMap &extraVars) { m_extraVars = extraVars; }
void setExtraConfigs(const ProStringList &extraConfigs) { m_extraConfigs = extraConfigs; }
#endif
ProStringList values(const ProKey &variableName) const;
ProStringList &valuesRef(const ProKey &variableName);
ProString first(const ProKey &variableName) const;
......@@ -232,6 +237,10 @@ public:
QStack<Location> m_locationStack; // All execution location changes
QStack<ProFile *> m_profileStack; // Includes only
#ifdef QT_BUILD_QMAKE
ProValueMap m_extraVars;
ProStringList m_extraConfigs;
#endif
QString m_outputDir;
int m_listCount;
......
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