qmake: don't drop non-existing files from .depend_command output

this allows for dynamic generation of the dependencies.

Task-number: QTBUG-61267
Change-Id: If5b8aed6b9e4bde189cc3ba6a5f13dcf8def3a1e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Oswald Buddenhagen 2018-04-09 18:46:49 +02:00 committed by Kai Koehne
parent 92c5f3fb7b
commit 80dea66424

View File

@ -1997,7 +1997,9 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
for(int i = 0; i < dep_cmd_deps.count(); ++i) {
QString &file = dep_cmd_deps[i];
QString absFile = outDir.absoluteFilePath(file);
if (exists(absFile)) {
if (absFile == file) {
// already absolute; don't do any checks.
} else if (exists(absFile)) {
file = absFile;
} else {
QString localFile;
@ -2016,7 +2018,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
" prints paths relative to source directory",
(*it).toLatin1().constData());
else
file.clear();
file = absFile; // fallback for generated resources
} else {
file = localFile;
}
@ -2090,7 +2092,9 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
for(int i = 0; i < dep_cmd_deps.count(); ++i) {
QString &file = dep_cmd_deps[i];
QString absFile = outDir.absoluteFilePath(file);
if (exists(absFile)) {
if (absFile == file) {
// already absolute; don't do any checks.
} else if (exists(absFile)) {
file = absFile;
} else {
QString localFile;
@ -2109,7 +2113,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
" prints paths relative to source directory",
(*it).toLatin1().constData());
else
file.clear();
file = absFile; // fallback for generated resources
} else {
file = localFile;
}