summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2010-07-06 17:39:52 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2010-07-07 09:46:24 (GMT)
commitb139e7e96e5c47b412c4f0bbc4ae11d5cca99e61 (patch)
tree93c36e980ddac04e2aef8f0223f9aca84a205236 /qmake
parent047dd2d73fab867187d17f684be464233f64165b (diff)
downloadQt-b139e7e96e5c47b412c4f0bbc4ae11d5cca99e61.zip
Qt-b139e7e96e5c47b412c4f0bbc4ae11d5cca99e61.tar.gz
Qt-b139e7e96e5c47b412c4f0bbc4ae11d5cca99e61.tar.bz2
run dep commands in build dir
the file names are given relative to the build directory, so the command needs to be run in it as well. this is a more expected (and simpler) fix than the alternative, which would be giving file names relative to the source directory. reasons not to fix: - due to some other bug, the problem really affects only builds where the build dir is not at the same level as the source dir - otherwise, absolute paths would be passed anyway - it has some breakage potential for the cases where the commands actually expect being run in the source dir - it can be worked around by manually injecting the cd statement into the command reasons why i still fixed it: - it doesn't affect in-source builds, and it seems that most complex build systems (which would define custom compilers with depend_command) don't support shadow builds anyway - people who needed things to work probably already used $$OUT_PWD somehow (either a "cd" at the start, or prepending it to each path), so this change will be practically a no-op - "it's just dependencies, and these are known to be broken in qmake anyway" Reviewed-by: joerg Task-number: QTBUG-1918
Diffstat (limited to 'qmake')
-rw-r--r--qmake/generators/makefile.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index d6b3e09..45a96f5 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -1756,6 +1756,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
}
QStringList tmp_dep = project->values((*it) + ".depends");
QString tmp_dep_cmd;
+ QString dep_cd_cmd;
if(!project->isEmpty((*it) + ".depend_command")) {
int argv0 = -1;
QStringList cmdline = project->values((*it) + ".depend_command");
@@ -1774,6 +1775,9 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
cmdline[argv0] = escapeFilePath(cmdline.at(argv0));
}
}
+ dep_cd_cmd = QLatin1String("cd ")
+ + escapeFilePath(Option::fixPathToLocalOS(Option::output_dir, false))
+ + QLatin1String(" && ");
}
QStringList &vars = project->values((*it) + ".variables");
if(tmp_out.isEmpty() || tmp_cmd.isEmpty())
@@ -1875,7 +1879,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
char buff[256];
QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, (*input),
tmp_out);
- dep_cmd = fixEnvVariables(dep_cmd);
+ dep_cmd = dep_cd_cmd + fixEnvVariables(dep_cmd);
if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) {
QString indeps;
while(!feof(proc)) {
@@ -1973,7 +1977,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
if(!tmp_dep_cmd.isEmpty() && doDepends()) {
char buff[256];
QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, (*input), out);
- dep_cmd = fixEnvVariables(dep_cmd);
+ dep_cmd = dep_cd_cmd + fixEnvVariables(dep_cmd);
if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) {
QString indeps;
while(!feof(proc)) {