From 15e9c3301ce90a24de909e36d8091782987c34bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 18 Sep 2013 18:17:51 +0200 Subject: Strengthen check for combined QMAKE_EXTRA_COMPILER with variable output The pattern ${QMAKE_ needs to be at the beginning of the line, or not start with a $ (which would make it a regular qmake variable). Also, it's fine that the variable is of the QMAKE_VAR_foo type, as these variables are resolved at generator time, but are constant and do not depend on the inputs. This means we have to replace extra variables in the output. Change-Id: I21ad24ae770f2137e2d5d92a20ee54e2f3f4ca06 Reviewed-by: Joerg Bornemann --- qmake/generators/makefile.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'qmake') diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 766904cd60..f85433c6a1 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -1955,7 +1955,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) } QStringList tmp_dep = project->values(ProKey(*it + ".depends")).toQStringList(); if (config.indexOf("combine") != -1) { - if(tmp_out.indexOf("${QMAKE_") != -1) { + if (tmp_out.contains(QRegExp("(^|[^$])\\$\\{QMAKE_(?!VAR_)"))) { warn_msg(WarnLogic, "QMAKE_EXTRA_COMPILERS(%s) with combine has variable output.", (*it).toLatin1().constData()); continue; @@ -2031,8 +2031,9 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) if (inputs.isEmpty()) continue; - QString cmd = replaceExtraCompilerVariables(tmp_cmd, escapeFilePaths(inputs), QStringList(tmp_out)); - t << escapeDependencyPath(tmp_out) << ":"; + QString out = replaceExtraCompilerVariables(tmp_out, QString(), QString()); + QString cmd = replaceExtraCompilerVariables(tmp_cmd, escapeFilePaths(inputs), QStringList() << out); + t << escapeDependencyPath(out) << ":"; // compiler.CONFIG+=explicit_dependencies means that ONLY compiler.depends gets to cause Makefile dependencies if (config.indexOf("explicit_dependencies") != -1) { t << " " << valList(escapeDependencyPaths(fileFixify(tmp_dep, Option::output_dir, Option::output_dir))); -- cgit v1.2.3