summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorRohan McGovern <rohan.mcgovern@nokia.com>2009-05-26 10:46:54 +1000
committerRohan McGovern <rohan.mcgovern@nokia.com>2009-05-26 11:18:23 +1000
commit2248d63c1a32ae84bb6d0bde9021a8074db1b4c9 (patch)
tree5351227c2f01ecf78e0be31bfaecd0d4e75c4972 /qmake
parenta4ca38bab521e1f0095b9c90c4623ca9d41d219b (diff)
Fixed qmake writing targets into the root of the current drive when
DESTDIR=./ and using Windows, nmake and shadow builds. qmake would canonicalize the DESTDIR of "./" to "". Then it would check if the original DESTDIR ended with "/", and if so, append it to the new DESTDIR, resulting in a DESTDIR of "/" - the root of the current drive. Don't do that. This bug doesn't occur with in-source builds because qmake detects that the source and build directories are the same directory and replaces the DESTDIR of "./" with "" before it reaches the buggy code. Autotest: included Reviewed-by: Lincoln Ramsay
Diffstat (limited to 'qmake')
-rw-r--r--qmake/generators/win32/winmakefile.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index 87f55cf318..c7f00ddad7 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -626,7 +626,7 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
// do this here so we can set DEST_TARGET to be the complete path to the final target if it is needed.
QString orgDestDir = var("DESTDIR");
QString destDir = Option::fixPathToTargetOS(orgDestDir, false);
- if (orgDestDir.endsWith('/') || orgDestDir.endsWith(Option::dir_sep))
+ if (!destDir.isEmpty() && (orgDestDir.endsWith('/') || orgDestDir.endsWith(Option::dir_sep)))
destDir += Option::dir_sep;
QString target = QString(project->first("TARGET")+project->first("TARGET_EXT"));
target.remove("\"");