diff options
author | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2018-04-09 18:34:18 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2018-04-25 18:52:49 +0000 |
commit | 75587c8030ff8057b90200cb20cff1e4549c00b5 (patch) | |
tree | 977cc5b634974b305bd6a91e92bc552ad05b9921 /qmake/generators/makefile.cpp | |
parent | 395a19f0325e883749dde76849bd1092a711d802 (diff) |
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 <joerg.bornemann@qt.io>
Diffstat (limited to 'qmake/generators/makefile.cpp')
-rw-r--r-- | qmake/generators/makefile.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
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<QMakeLocalFileName> depdirs = QMakeSourceFileInfo::dependencyPaths(); for (QList<QMakeLocalFileName>::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<QMakeLocalFileName> depdirs = QMakeSourceFileInfo::dependencyPaths(); for (QList<QMakeLocalFileName>::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; } } |