QmakeProjectManager: Compare the right set of arguments

... when determining whether to re-run qmake.
We need to look at the effective arguments, not the user arguments.
Of course, the whole approach is still a shaky heuristic, but it should
be more correct now than it was before.

Fixes: QTCREATORBUG-24538
Change-Id: I763f8095becacde0f9549890161b8a47c6344b6b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Christian Kandeler
2020-09-08 10:32:17 +02:00
parent d7229d4afc
commit 1e452f1ad3
4 changed files with 26 additions and 20 deletions

View File

@@ -490,7 +490,7 @@ QmakeBuildConfiguration::MakefileState QmakeBuildConfiguration::compareToImportF
qCDebug(logs) << "QMakeBuildConfiguration::compareToImport";
QMakeStep *qs = qmakeStep();
MakeFileParse parse(makefile);
MakeFileParse parse(makefile, MakeFileParse::Mode::DoNotFilterKnownConfigValues);
if (parse.makeFileState() == MakeFileParse::MakefileMissing) {
qCDebug(logs) << "**Makefile missing";
@@ -546,10 +546,12 @@ QmakeBuildConfiguration::MakefileState QmakeBuildConfiguration::compareToImportF
// and compare that on its own
QString workingDirectory = QFileInfo(makefile).absolutePath();
QStringList actualArgs;
QString userArgs = macroExpander()->expandProcessArgs(qs->userArguments());
// This copies the settings from userArgs to actualArgs (minus some we
QString allArgs = macroExpander()->expandProcessArgs(qs->allArguments(
QtKitAspect::qtVersion(target()->kit()), QMakeStep::ArgumentFlag::Expand));
// This copies the settings from allArgs to actualArgs (minus some we
// are not interested in), splitting them up into individual strings:
extractSpecFromArguments(&userArgs, workingDirectory, version, &actualArgs);
extractSpecFromArguments(&allArgs, workingDirectory, version, &actualArgs);
actualArgs.removeFirst(); // Project file.
const QString actualSpec = qs->mkspec();
QString qmakeArgs = parse.unparsedArguments();