From 34cc41d8a17e6e30f01f22c5d382c28d49ae37e1 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 3 Jan 2017 19:10:14 +0100 Subject: don't pass qmake configure arguments to sub-projects the arguments after '--' are by definition meant only for the top-level project, as that's where configure is invoked from. passing them to sub-projects just adds noise to the make output and misleads users. note that this specifically does not support qmake -r, which will break if the subprojects rely on the arguments being absent. this isn't a problem, because the qt build doesn't support qmake -r anyway. Change-Id: I7ecff6212ce3137526005fc324a4a7ae45e3345e Reviewed-by: Joerg Bornemann --- qmake/generators/makefile.cpp | 15 ++++++++++----- qmake/generators/makefile.h | 2 +- qmake/generators/unix/unixmake2.cpp | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) (limited to 'qmake/generators') diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 1ba2587bd0..2845888dde 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -2254,12 +2254,17 @@ MakefileGenerator::writeDefaultVariables(QTextStream &t) t << "MOVE = " << var("QMAKE_MOVE") << endl; } -QString MakefileGenerator::buildArgs() +QString MakefileGenerator::buildArgs(bool withExtra) { QString ret; for (const QString &arg : qAsConst(Option::globals->qmake_args)) ret += " " + shellQuote(arg); + if (withExtra && !Option::globals->qmake_extra_args.isEmpty()) { + ret += " --"; + for (const QString &arg : qAsConst(Option::globals->qmake_extra_args)) + ret += " " + shellQuote(arg); + } return ret; } @@ -2278,7 +2283,7 @@ QString MakefileGenerator::build_args() ret += " " + escapeFilePath(fileFixify(project->projectFile())); // general options and arguments - ret += buildArgs(); + ret += buildArgs(true); return ret; } @@ -2442,7 +2447,7 @@ MakefileGenerator::writeSubTargetCall(QTextStream &t, if (!in_directory.isEmpty()) t << "\n\t" << mkdir_p_asstring(out_directory); pfx = "( " + chkexists.arg(out) + - + " $(QMAKE) -o " + out + ' ' + in + buildArgs() + + " $(QMAKE) -o " + out + ' ' + in + buildArgs(false) + " ) && "; } writeSubMakeCall(t, out_directory_cdin + pfx, makefilein); @@ -2513,7 +2518,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 " << files.join(' ') << ' ' << buildArgs() << endl; + << "@$(QMAKE) -prl " << files.join(' ') << ' ' << buildArgs(true) << endl; } QString qmake = build_args(); diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h index 86fec748eb..4ced3bd121 100644 --- a/qmake/generators/makefile.h +++ b/qmake/generators/makefile.h @@ -178,7 +178,7 @@ protected: QString specdir(); //subclasses can use these to query information about how the generator was "run" - QString buildArgs(); + QString buildArgs(bool withExtra); virtual QStringList &findDependencies(const QString &file); virtual bool doDepends() const { return Option::mkfile::do_deps; } diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 6fa355390f..946906ba65 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 " << escapeFilePath(project->projectFile()) << ' ' << buildArgs() << endl; + << "@$(QMAKE) -prl " << escapeFilePath(project->projectFile()) << ' ' << buildArgs(true) << endl; } if (!project->isEmpty("QMAKE_BUNDLE")) { -- cgit v1.2.3