diff options
author | Oswald Buddenhagen <oswald.buddenhagen@digia.com> | 2012-09-19 21:56:16 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-09-21 02:44:22 +0200 |
commit | 0da7f097249f71726140a38647bb4824b09fad7b (patch) | |
tree | e305e9660beb4b4305d3781e8403de86e186a99c /qmake/project.cpp | |
parent | b6acec1e5d55d03ad3a0a70d2cf371d3f8fde629 (diff) |
make error() abort the qmake run, not just the current file
Change-Id: I82fc55680f9ffb227e25acb39c797596225ba89e
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Diffstat (limited to 'qmake/project.cpp')
-rw-r--r-- | qmake/project.cpp | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/qmake/project.cpp b/qmake/project.cpp index 478693f78b..1b352796a5 100644 --- a/qmake/project.cpp +++ b/qmake/project.cpp @@ -63,6 +63,14 @@ QMakeProject::QMakeProject(QMakeProject *p) initFrom(*p); } +bool QMakeProject::boolRet(VisitReturn vr) +{ + if (vr == ReturnError) + exit(3); + Q_ASSERT(vr == ReturnTrue || vr == ReturnFalse); + return vr != ReturnFalse; +} + bool QMakeProject::read(const QString &project, LoadFlags what) { m_projectFile = project; @@ -70,7 +78,7 @@ bool QMakeProject::read(const QString &project, LoadFlags what) QString absproj = (project == QLatin1String("-")) ? QLatin1String("(stdin)") : QDir::cleanPath(QDir(qmake_getpwd()).absoluteFilePath(project)); - return evaluateFile(absproj, QMakeHandler::EvalProjectFile, what); + return boolRet(evaluateFile(absproj, QMakeHandler::EvalProjectFile, what)); } static ProStringList prepareBuiltinArgs(const QList<ProStringList> &args) @@ -87,12 +95,12 @@ bool QMakeProject::test(const ProKey &func, const QList<ProStringList> &args) m_current.clear(); if (int func_t = statics.functions.value(func)) - return evaluateBuiltinConditional(func_t, func, prepareBuiltinArgs(args)) == ReturnTrue; + return boolRet(evaluateBuiltinConditional(func_t, func, prepareBuiltinArgs(args))); QHash<ProKey, ProFunctionDef>::ConstIterator it = m_functionDefs.testFunctions.constFind(func); if (it != m_functionDefs.testFunctions.constEnd()) - return evaluateBoolFunction(*it, args, func) == ReturnTrue; + return boolRet(evaluateBoolFunction(*it, args, func)); evalError(QStringLiteral("'%1' is not a recognized test function.") .arg(func.toQString(m_tmp1))); @@ -108,8 +116,13 @@ QStringList QMakeProject::expand(const ProKey &func, const QList<ProStringList> QHash<ProKey, ProFunctionDef>::ConstIterator it = m_functionDefs.replaceFunctions.constFind(func); - if (it != m_functionDefs.replaceFunctions.constEnd()) - return evaluateFunction(*it, args, 0).toQStringList(); + if (it != m_functionDefs.replaceFunctions.constEnd()) { + QMakeProject::VisitReturn vr; + ProStringList ret = evaluateFunction(*it, args, &vr); + if (vr == QMakeProject::ReturnError) + exit(3); + return ret.toQStringList(); + } evalError(QStringLiteral("'%1' is not a recognized replace function.") .arg(func.toQString(m_tmp1))); |