From f57e2f5667c1eb72b5cbe3ad650dac2f6ca4f8a0 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 15 Jul 2013 15:10:09 +0200 Subject: 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 Task-number: QTBUG-19352 Change-Id: I75de9444a647cd9e6f509e3d8eb3382dc985e5ca Reviewed-by: Joerg Bornemann --- qmake/generators/makefile.cpp | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) (limited to 'qmake/generators/makefile.cpp') 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 depdirs = QMakeSourceFileInfo::dependencyPaths(); for (QList::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 depdirs = QMakeSourceFileInfo::dependencyPaths(); for (QList::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); -- cgit v1.2.3