forked from qt-creator/qt-creator
add support for extra vars and extra configs
will be needed for qmake build passes Change-Id: I6c887abd8e9e858954ce90c60ccdd1b70b6aeee3 Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
@@ -1279,6 +1279,12 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProFile(
|
|||||||
loadDefaults();
|
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_handler->aboutToEval(currentProFile(), pro, type);
|
||||||
m_profileStack.push(pro);
|
m_profileStack.push(pro);
|
||||||
valuesRef(ProKey("PWD")) = ProStringList(ProString(currentDirectory()));
|
valuesRef(ProKey("PWD")) = ProStringList(ProString(currentDirectory()));
|
||||||
@@ -1288,6 +1294,12 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProFile(
|
|||||||
evaluateFeatureFile(QLatin1String("default_pre.prf"));
|
evaluateFeatureFile(QLatin1String("default_pre.prf"));
|
||||||
|
|
||||||
evaluateCommand(m_option->precmds, fL1S("(command line)"));
|
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()));
|
debugMsg(1, "visiting file %s", qPrintable(pro->fileName()));
|
||||||
@@ -1297,6 +1309,14 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProFile(
|
|||||||
if (flags & LoadPostFiles) {
|
if (flags & LoadPostFiles) {
|
||||||
evaluateCommand(m_option->postcmds, fL1S("(command line -after)"));
|
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"));
|
evaluateFeatureFile(QLatin1String("default_post.prf"));
|
||||||
|
|
||||||
QSet<QString> processed;
|
QSet<QString> processed;
|
||||||
|
@@ -89,6 +89,11 @@ public:
|
|||||||
QMakeHandler *handler);
|
QMakeHandler *handler);
|
||||||
~QMakeEvaluator();
|
~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 values(const ProKey &variableName) const;
|
||||||
ProStringList &valuesRef(const ProKey &variableName);
|
ProStringList &valuesRef(const ProKey &variableName);
|
||||||
ProString first(const ProKey &variableName) const;
|
ProString first(const ProKey &variableName) const;
|
||||||
@@ -232,6 +237,10 @@ public:
|
|||||||
QStack<Location> m_locationStack; // All execution location changes
|
QStack<Location> m_locationStack; // All execution location changes
|
||||||
QStack<ProFile *> m_profileStack; // Includes only
|
QStack<ProFile *> m_profileStack; // Includes only
|
||||||
|
|
||||||
|
#ifdef QT_BUILD_QMAKE
|
||||||
|
ProValueMap m_extraVars;
|
||||||
|
ProStringList m_extraConfigs;
|
||||||
|
#endif
|
||||||
QString m_outputDir;
|
QString m_outputDir;
|
||||||
|
|
||||||
int m_listCount;
|
int m_listCount;
|
||||||
|
Reference in New Issue
Block a user