summaryrefslogtreecommitdiffstats
path: root/qmake/generators/makefile.cpp
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@digia.com>2013-07-15 15:10:09 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-07-22 19:52:06 +0200
commitf57e2f5667c1eb72b5cbe3ad650dac2f6ca4f8a0 (patch)
tree93c71bd7f4a9a6904dfa94566c394bf056dbcf1c /qmake/generators/makefile.cpp
parent08db2caf6344bad88675c58250fc6b04399c29f5 (diff)
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>
Diffstat (limited to 'qmake/generators/makefile.cpp')
-rw-r--r--qmake/generators/makefile.cpp32
1 files changed, 28 insertions, 4 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 1f2ebcf50e..0ec4a5f235 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -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);