Commit 32f3ecca authored by Oswald Buddenhagen's avatar Oswald Buddenhagen

make error() propagate from requires() and REQUIRES=

that can make sense if a function which determines the availability of
a dependency fails to do so for unexpected reasons.

Change-Id: If6cd113df25aee66830c120a2fab067c822a4543
Reviewed-by: Joerg Bornemann's avatarJoerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from qtbase/1b4ea11332f74984a62a4cc4597ad49f5b5269dc)
Reviewed-by: Jake Petroules's avatarJake Petroules <jake.petroules@qt.io>
parent 3fe303eb
......@@ -1194,7 +1194,8 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
return ReturnFalse;
case T_REQUIRES:
#ifdef PROEVALUATOR_FULL
checkRequirements(args);
if (checkRequirements(args) == ReturnError)
return ReturnError;
#endif
return ReturnFalse; // Another qmake breakage
case T_EVAL: {
......
......@@ -925,7 +925,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProVariable(
}
#ifdef PROEVALUATOR_FULL
else if (varName == statics.strREQUIRES)
checkRequirements(values(varName));
return checkRequirements(values(varName));
#endif
return ReturnTrue;
......@@ -1787,12 +1787,17 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateConditional(
}
#ifdef PROEVALUATOR_FULL
void QMakeEvaluator::checkRequirements(const ProStringList &deps)
QMakeEvaluator::VisitReturn QMakeEvaluator::checkRequirements(const ProStringList &deps)
{
ProStringList &failed = valuesRef(ProKey("QMAKE_FAILED_REQUIREMENTS"));
foreach (const ProString &dep, deps)
if (evaluateConditional(dep.toQString(), m_current.pro->fileName(), m_current.line) != ReturnTrue)
foreach (const ProString &dep, deps) {
VisitReturn vr = evaluateConditional(dep.toQString(), m_current.pro->fileName(), m_current.line);
if (vr == ReturnError)
return ReturnError;
if (vr != ReturnTrue)
failed << dep;
}
return ReturnTrue;
}
#endif
......
......@@ -213,7 +213,7 @@ public:
VisitReturn evaluateConditional(const QString &cond, const QString &where, int line = -1);
#ifdef PROEVALUATOR_FULL
void checkRequirements(const ProStringList &deps);
VisitReturn checkRequirements(const ProStringList &deps);
#endif
void updateMkspecPaths();
......
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