diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2011-03-23 11:31:48 (GMT) |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2011-04-12 09:58:37 (GMT) |
commit | 3838388e8143ac5f5e1f3688f9ba31190fd9bbd3 (patch) | |
tree | 5be42ece1ad50ce480a7a84b16811f85aca46566 /qmake | |
parent | c4dd5b7eb3b8a212d2f80bbca2a2713a57cf1247 (diff) | |
download | Qt-3838388e8143ac5f5e1f3688f9ba31190fd9bbd3.zip Qt-3838388e8143ac5f5e1f3688f9ba31190fd9bbd3.tar.gz Qt-3838388e8143ac5f5e1f3688f9ba31190fd9bbd3.tar.bz2 |
useful location reporting for errors from QMAKE_SUBSTITUTES
Reviewed-by: mariusSO
Diffstat (limited to 'qmake')
-rw-r--r-- | qmake/generators/makefile.cpp | 2 | ||||
-rw-r--r-- | qmake/project.cpp | 14 | ||||
-rw-r--r-- | qmake/project.h | 1 |
3 files changed, 16 insertions, 1 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index c13f38e..f9eba22 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 16200f1..d4f21be 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<QString, QStringList> 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<QStringList> &args) { diff --git a/qmake/project.h b/qmake/project.h index 09aa45e..0e6131d 100644 --- a/qmake/project.h +++ b/qmake/project.h @@ -144,6 +144,7 @@ public: QMap<QString, QStringList> &place); QStringList expand(const QString &v); + QString expand(const QString &v, const QString &file, int line); QStringList expand(const QString &func, const QList<QStringList> &args); bool test(const QString &v); bool test(const QString &func, const QList<QStringList> &args); |