forked from qt-creator/qt-creator
refactor pre, post and CONFIG feature inclusion
actually use evaluateFeatureFile() instead of hand-crafting stuff
This commit is contained in:
@@ -802,19 +802,21 @@ ProItem::ProItemReturn ProFileEvaluator::Private::visitBeginProFile(ProFile * pr
|
|||||||
|
|
||||||
m_profileStack.push(pro);
|
m_profileStack.push(pro);
|
||||||
|
|
||||||
|
if (m_parsePreAndPostFiles) {
|
||||||
const QString mkspecDirectory = propertyValue(QLatin1String("QMAKE_MKSPECS"));
|
const QString mkspecDirectory = propertyValue(QLatin1String("QMAKE_MKSPECS"));
|
||||||
if (!mkspecDirectory.isEmpty() && m_parsePreAndPostFiles) {
|
if (!mkspecDirectory.isEmpty()) {
|
||||||
bool cumulative = m_cumulative;
|
bool cumulative = m_cumulative;
|
||||||
m_cumulative = false;
|
m_cumulative = false;
|
||||||
evaluateFile(mkspecDirectory + QLatin1String("/default/qmake.conf"));
|
evaluateFile(mkspecDirectory + QLatin1String("/default/qmake.conf"));
|
||||||
evaluateFile(mkspecDirectory + QLatin1String("/features/default_pre.prf"));
|
m_cumulative = cumulative;
|
||||||
|
}
|
||||||
|
evaluateFeatureFile(QLatin1String("default_pre.prf"));
|
||||||
|
|
||||||
QStringList tmp = m_valuemap.value(QLatin1String("CONFIG"));
|
QStringList tmp = m_valuemap.value(QLatin1String("CONFIG"));
|
||||||
tmp.append(m_addUserConfigCmdArgs);
|
tmp.append(m_addUserConfigCmdArgs);
|
||||||
foreach (const QString &remove, m_removeUserConfigCmdArgs)
|
foreach (const QString &remove, m_removeUserConfigCmdArgs)
|
||||||
tmp.removeAll(remove);
|
tmp.removeAll(remove);
|
||||||
m_valuemap.insert(QLatin1String("CONFIG"), tmp);
|
m_valuemap.insert(QLatin1String("CONFIG"), tmp);
|
||||||
m_cumulative = cumulative;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return returnBool(QDir::setCurrent(pro->directoryName()));
|
return returnBool(QDir::setCurrent(pro->directoryName()));
|
||||||
@@ -828,13 +830,8 @@ ProItem::ProItemReturn ProFileEvaluator::Private::visitEndProFile(ProFile * pro)
|
|||||||
PRE(pro);
|
PRE(pro);
|
||||||
m_lineNo = pro->lineNumber();
|
m_lineNo = pro->lineNumber();
|
||||||
if (m_profileStack.count() == 1 && !m_oldPath.isEmpty()) {
|
if (m_profileStack.count() == 1 && !m_oldPath.isEmpty()) {
|
||||||
const QString &mkspecDirectory = propertyValue(QLatin1String("QMAKE_MKSPECS"));
|
|
||||||
if (!mkspecDirectory.isEmpty()) {
|
|
||||||
if (m_parsePreAndPostFiles) {
|
if (m_parsePreAndPostFiles) {
|
||||||
bool cumulative = m_cumulative;
|
evaluateFeatureFile(QLatin1String("default_post.prf"));
|
||||||
m_cumulative = false;
|
|
||||||
|
|
||||||
evaluateFile(mkspecDirectory + QLatin1String("/features/default_post.prf"));
|
|
||||||
|
|
||||||
QSet<QString> processed;
|
QSet<QString> processed;
|
||||||
forever {
|
forever {
|
||||||
@@ -844,8 +841,7 @@ ProItem::ProItemReturn ProFileEvaluator::Private::visitEndProFile(ProFile * pro)
|
|||||||
const QString config = configs[i].toLower();
|
const QString config = configs[i].toLower();
|
||||||
if (!processed.contains(config)) {
|
if (!processed.contains(config)) {
|
||||||
processed.insert(config);
|
processed.insert(config);
|
||||||
if (evaluateFile(mkspecDirectory + QLatin1String("/features/")
|
if (evaluateFeatureFile(config)) {
|
||||||
+ config + QLatin1String(".prf"))) {
|
|
||||||
finished = false;
|
finished = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -854,8 +850,6 @@ ProItem::ProItemReturn ProFileEvaluator::Private::visitEndProFile(ProFile * pro)
|
|||||||
if (finished)
|
if (finished)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
m_cumulative = cumulative;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (ProBlock *itm, m_replaceFunctions)
|
foreach (ProBlock *itm, m_replaceFunctions)
|
||||||
|
|||||||
Reference in New Issue
Block a user