summaryrefslogtreecommitdiffstats
path: root/qmake/generators/unix
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-10-13 17:09:33 +0200
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-10-14 14:57:54 +0000
commitbc00f3c2289f2962a99c61cf27002f2991efd8e3 (patch)
tree431ea9ac50480eb5f7f94bca19f4b09538fcb3e2 /qmake/generators/unix
parent233d0a6b8d497fa7ef43c02b9bb551ac48454773 (diff)
fix the trailing-backslash-in-DESTDIR-on-mingw workaround
at least the mingw version we use now interprets the sequence \# as a literal hashmark, which completely defeats the previous hack. the new hack escapes the backslash with another backslash, which appears to work. however, make does *not* remove the additional backslash, so the result is a bit ugly. Change-Id: I591a2be443880b162094d04e5a5e624216b59311 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'qmake/generators/unix')
-rw-r--r--qmake/generators/unix/unixmake2.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp
index d0cd5d2354..9db64bebee 100644
--- a/qmake/generators/unix/unixmake2.cpp
+++ b/qmake/generators/unix/unixmake2.cpp
@@ -262,11 +262,13 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "DIST = " << valList(fileFixify(project->values("DISTFILES").toQStringList())) << " "
<< fileVarList("HEADERS") << ' ' << fileVarList("SOURCES") << endl;
t << "QMAKE_TARGET = " << fileVar("QMAKE_ORIG_TARGET") << endl;
- // The comment is important for mingw32-make.exe on Windows as otherwise trailing slashes
- // would be interpreted as line continuation. The lack of spacing between the value and the
- // comment is also important as otherwise quoted use of "$(DESTDIR)" would include this
- // spacing.
- t << "DESTDIR = " << fileVar("DESTDIR") << "#avoid trailing-slash linebreak\n";
+ QString destd = fileVar("DESTDIR");
+ // When building on non-MSys MinGW, the path ends with a backslash, which
+ // GNU make will interpret that as a line continuation. Doubling the backslash
+ // avoids the problem, at the cost of the variable containing *both* backslashes.
+ if (destd.endsWith('\\'))
+ destd += '\\';
+ t << "DESTDIR = " << destd << endl;
t << "TARGET = " << fileVar("TARGET") << endl; // ### mixed use!
if(project->isActiveConfig("plugin")) {
t << "TARGETD = " << fileVar("TARGET") << endl;