resolve output of .depend_command relative to $$OUT_PWD

... as that is the CWD of the command (since b139e7e96e5c).
leave the resolution relative to $$PWD as a fallback with a warning.

Investigated-by: Harald Hvaal <hhvaal@cisco.com>
Task-number: QTBUG-19352
Change-Id: I75de9444a647cd9e6f509e3d8eb3382dc985e5ca
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
This commit is contained in:
Oswald Buddenhagen 2013-07-15 15:10:09 +02:00 committed by The Qt Project
parent 08db2caf63
commit f57e2f5667

View File

@ -1984,7 +1984,10 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
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];
if(!exists(file)) {
QString absFile = QDir(Option::output_dir).absoluteFilePath(file);
if (exists(absFile)) {
file = absFile;
} else {
QString localFile;
QList<QMakeLocalFileName> depdirs = QMakeSourceFileInfo::dependencyPaths();
for (QList<QMakeLocalFileName>::Iterator dit = depdirs.begin();
@ -1994,7 +1997,16 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
break;
}
}
file = localFile;
if (localFile.isEmpty()) {
if (exists(file))
warn_msg(WarnDeprecated, ".depend_command for extra compiler %s"
" prints paths relative to source directory",
(*it).toLatin1().constData());
else
file.clear();
} else {
file = localFile;
}
}
if(!file.isEmpty())
file = fileFixify(file);
@ -2062,7 +2074,10 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
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];
if(!exists(file)) {
QString absFile = QDir(Option::output_dir).absoluteFilePath(file);
if (exists(absFile)) {
file = absFile;
} else {
QString localFile;
QList<QMakeLocalFileName> depdirs = QMakeSourceFileInfo::dependencyPaths();
for (QList<QMakeLocalFileName>::Iterator dit = depdirs.begin();
@ -2072,7 +2087,16 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
break;
}
}
file = localFile;
if (localFile.isEmpty()) {
if (exists(file))
warn_msg(WarnDeprecated, ".depend_command for extra compiler %s"
" prints paths relative to source directory",
(*it).toLatin1().constData());
else
file.clear();
} else {
file = localFile;
}
}
if(!file.isEmpty())
file = fileFixify(file);