From 75587c8030ff8057b90200cb20cff1e4549c00b5 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 9 Apr 2018 18:34:18 +0200 Subject: qmake: fix look-up of relative files from .depend_command in shadow builds the dependency paths are fixified against the output directory, so we must resolve them accordingly. Change-Id: Id92750aad358153bd2db5daca3194c54eda58dbb Reviewed-by: Joerg Bornemann --- qmake/generators/makefile.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'qmake') diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 82573347b6..99aecdd8ce 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -1953,11 +1953,12 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) } QT_PCLOSE(proc); if(!indeps.isEmpty()) { + QDir outDir(Option::output_dir); // ### This is basically fubar. Add 'lines' flag to CONFIG? QStringList dep_cmd_deps = indeps.replace('\n', ' ').simplified().split(' '); for(int i = 0; i < dep_cmd_deps.count(); ++i) { QString &file = dep_cmd_deps[i]; - QString absFile = QDir(Option::output_dir).absoluteFilePath(file); + QString absFile = outDir.absoluteFilePath(file); if (exists(absFile)) { file = absFile; } else { @@ -1965,8 +1966,9 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) QList depdirs = QMakeSourceFileInfo::dependencyPaths(); for (QList::Iterator dit = depdirs.begin(); dit != depdirs.end(); ++dit) { - if (exists((*dit).local() + '/' + file)) { - localFile = (*dit).local() + '/' + file; + QString lf = outDir.absoluteFilePath((*dit).local() + '/' + file); + if (exists(lf)) { + localFile = lf; break; } } @@ -2045,11 +2047,12 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) } QT_PCLOSE(proc); if(!indeps.isEmpty()) { + QDir outDir(Option::output_dir); // ### This is basically fubar. Add 'lines' flag to CONFIG? QStringList dep_cmd_deps = indeps.replace('\n', ' ').simplified().split(' '); for(int i = 0; i < dep_cmd_deps.count(); ++i) { QString &file = dep_cmd_deps[i]; - QString absFile = QDir(Option::output_dir).absoluteFilePath(file); + QString absFile = outDir.absoluteFilePath(file); if (exists(absFile)) { file = absFile; } else { @@ -2057,8 +2060,9 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) QList depdirs = QMakeSourceFileInfo::dependencyPaths(); for (QList::Iterator dit = depdirs.begin(); dit != depdirs.end(); ++dit) { - if (exists((*dit).local() + '/' + file)) { - localFile = (*dit).local() + '/' + file; + QString lf = outDir.absoluteFilePath((*dit).local() + '/' + file); + if (exists(lf)) { + localFile = lf; break; } } -- cgit v1.2.3