From 6a9f38a11d56bb3ba6ec59955f3220627c0d30b6 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 23 Aug 2016 17:39:33 +0200 Subject: fix argument order in recursive qmake invocations the inherited arguments may contain the '--' argument, which turns additional arguments into configure arguments. the simplest fix for that is injecting additional arguments at the front, not at the end. Change-Id: I7cc00a42f0148e5ccbbeda2ad59fa8c63749f02d Reviewed-by: Jake Petroules Reviewed-by: Lars Knoll --- qmake/generators/makefile.cpp | 12 ++++++------ qmake/generators/unix/unixmake2.cpp | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'qmake') diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 11b1c8329d..5d7700ec82 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -2269,9 +2269,6 @@ QString MakefileGenerator::build_args() { QString ret = "$(QMAKE)"; - // general options and arguments - ret += buildArgs(); - //output QString ofile = fileFixify(Option::output.fileName()); if(!ofile.isEmpty() && ofile != project->first("QMAKE_MAKEFILE")) @@ -2280,6 +2277,9 @@ QString MakefileGenerator::build_args() //inputs ret += " " + escapeFilePath(fileFixify(project->projectFile())); + // general options and arguments + ret += buildArgs(); + return ret; } @@ -2442,7 +2442,7 @@ MakefileGenerator::writeSubTargetCall(QTextStream &t, if (!in_directory.isEmpty()) t << "\n\t" << mkdir_p_asstring(out_directory); pfx = "( " + chkexists.arg(out) + - + " $(QMAKE) " + in + buildArgs() + " -o " + out + + " $(QMAKE) -o " + out + ' ' + in + buildArgs() + " ) && "; } writeSubMakeCall(t, out_directory_cdin + pfx, makefilein); @@ -2513,7 +2513,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QListisEmpty("QMAKE_FAILED_REQUIREMENTS") && !project->isEmpty("QMAKE_INTERNAL_PRL_FILE")) { QStringList files = escapeFilePaths(fileFixify(Option::mkfile::project_files)); t << escapeDependencyPath(project->first("QMAKE_INTERNAL_PRL_FILE").toQString()) << ": \n\t" - << "@$(QMAKE) -prl " << buildArgs() << " " << files.join(' ') << endl; + << "@$(QMAKE) -prl " << files.join(' ') << ' ' << buildArgs() << endl; } QString qmake = build_args(); diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index c53393e268..d437a0782b 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -731,7 +731,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) } if(!meta_files.isEmpty()) t << escapeDependencyPaths(meta_files).join(" ") << ": \n\t" - << "@$(QMAKE) -prl " << buildArgs() << ' ' << escapeFilePath(project->projectFile()) << endl; + << "@$(QMAKE) -prl " << escapeFilePath(project->projectFile()) << ' ' << buildArgs() << endl; } if (!project->isEmpty("QMAKE_BUNDLE")) { -- cgit v1.2.3