forked from qt-creator/qt-creator
add requires() function and REQUIRES magic variable
follow suit with qmake ... Change-Id: I6afc3898a01cc9926b9652b7f0f66becc255f01b Reviewed-by: Daniel Teske <daniel.teske@nokia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
This commit is contained in:
@@ -117,6 +117,9 @@ void QMakeEvaluator::initStatics()
|
||||
statics.strforever = QLatin1String("forever");
|
||||
statics.strhost_build = QLatin1String("host_build");
|
||||
statics.strTEMPLATE = ProString("TEMPLATE");
|
||||
#ifdef PROEVALUATOR_FULL
|
||||
statics.strREQUIRES = ProString("REQUIRES");
|
||||
#endif
|
||||
|
||||
statics.fakeValue = ProStringList(ProString("_FAKE_")); // It has to have a unique begin() value
|
||||
|
||||
@@ -837,6 +840,10 @@ void QMakeEvaluator::visitProVariable(
|
||||
|
||||
if (varName == statics.strTEMPLATE)
|
||||
setTemplate();
|
||||
#ifdef PROEVALUATOR_FULL
|
||||
else if (varName == statics.strREQUIRES)
|
||||
checkRequirements(values(varName));
|
||||
#endif
|
||||
}
|
||||
|
||||
void QMakeEvaluator::setTemplate()
|
||||
@@ -1527,6 +1534,16 @@ bool QMakeEvaluator::evaluateConditional(const QString &cond, const QString &con
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef PROEVALUATOR_FULL
|
||||
void QMakeEvaluator::checkRequirements(const ProStringList &deps)
|
||||
{
|
||||
ProStringList &failed = valuesRef(ProString("QMAKE_FAILED_REQUIREMENTS"));
|
||||
foreach (const ProString &dep, deps)
|
||||
if (!evaluateConditional(dep.toQString(), fL1S("(requires)")))
|
||||
failed << dep;
|
||||
}
|
||||
#endif
|
||||
|
||||
ProValueMap *QMakeEvaluator::findValues(const ProString &variableName, ProValueMap::Iterator *rit)
|
||||
{
|
||||
for (int i = m_valuemapStack.size(); --i >= 0; ) {
|
||||
|
||||
Reference in New Issue
Block a user