make messages from dynamic code tell a useful location

"(eval)" does not exactly help to find the error source.

Change-Id: Iecd03e6a4909ca6d7eab846844ca4415ebfa3429
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
Oswald Buddenhagen
2012-08-22 11:19:54 +02:00
parent 26e9f25a3e
commit 00e9be4246
8 changed files with 26 additions and 18 deletions

View File

@@ -1200,7 +1200,7 @@ void QMakeEvaluator::setupProject()
void QMakeEvaluator::visitCmdLine(const QString &cmds)
{
if (!cmds.isEmpty()) {
if (ProFile *pro = m_parser->parsedProBlock(fL1S("(command line)"), cmds)) {
if (ProFile *pro = m_parser->parsedProBlock(cmds, fL1S("(command line)"), -1)) {
if (pro->isOk()) {
m_locationStack.push(m_current);
visitProBlock(pro, pro->tokPtr());
@@ -1591,10 +1591,10 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBoolFunction(
return ReturnFalse;
}
bool QMakeEvaluator::evaluateConditional(const QString &cond, const QString &context)
bool QMakeEvaluator::evaluateConditional(const QString &cond, const QString &where, int line)
{
bool ret = false;
ProFile *pro = m_parser->parsedProBlock(context, cond, QMakeParser::TestGrammar);
ProFile *pro = m_parser->parsedProBlock(cond, where, line, QMakeParser::TestGrammar);
if (pro) {
if (pro->isOk()) {
m_locationStack.push(m_current);
@@ -1611,7 +1611,7 @@ void QMakeEvaluator::checkRequirements(const ProStringList &deps)
{
ProStringList &failed = valuesRef(ProKey("QMAKE_FAILED_REQUIREMENTS"));
foreach (const ProString &dep, deps)
if (!evaluateConditional(dep.toQString(), fL1S("(requires)")))
if (!evaluateConditional(dep.toQString(), m_current.pro->fileName(), m_current.line))
failed << dep;
}
#endif