From 3838388e8143ac5f5e1f3688f9ba31190fd9bbd3 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 23 Mar 2011 12:31:48 +0100 Subject: useful location reporting for errors from QMAKE_SUBSTITUTES Reviewed-by: mariusSO --- qmake/generators/makefile.cpp | 2 +- qmake/project.cpp | 14 ++++++++++++++ qmake/project.h | 1 + 3 files changed, 16 insertions(+), 1 deletion(-) (limited to 'qmake') diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index c13f38ebdb..f9eba22f64 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -545,7 +545,7 @@ MakefileGenerator::init() else state.pop(); } else if(state.isEmpty() || state.top() == IN_CONDITION) { - contents += project->expand(line).join(QString(Option::field_sep)); + contents += project->expand(line, in.fileName(), count); } } if(out.exists() && out.open(QFile::ReadOnly)) { diff --git a/qmake/project.cpp b/qmake/project.cpp index 16200f14e5..d4f21bebd7 100644 --- a/qmake/project.cpp +++ b/qmake/project.cpp @@ -2773,6 +2773,20 @@ QMakeProject::expand(const QString &str) return QStringList(); } +QString +QMakeProject::expand(const QString &str, const QString &file, int line) +{ + bool ok; + parser_info pi = parser; + parser.file = file; + parser.line_no = line; + parser.from_file = false; + QMap tmp = vars; + const QStringList ret = doVariableReplaceExpand(str, tmp, &ok); + parser = pi; + return ok ? ret.join(QString(Option::field_sep)) : QString(); +} + QStringList QMakeProject::expand(const QString &func, const QList &args) { diff --git a/qmake/project.h b/qmake/project.h index 09aa45e730..0e6131d3a2 100644 --- a/qmake/project.h +++ b/qmake/project.h @@ -144,6 +144,7 @@ public: QMap &place); QStringList expand(const QString &v); + QString expand(const QString &v, const QString &file, int line); QStringList expand(const QString &func, const QList &args); bool test(const QString &v); bool test(const QString &func, const QList &args); -- cgit v1.2.1