summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-05-01 08:23:55 -0400
committerBrad King <brad.king@kitware.com>2015-05-01 08:23:55 -0400
commitb84e9ae632ea78db87abca585785032c5b2b3e40 (patch)
treebde75f8d42f253cefc683e1fe1fdc27622cb6f1c
parent91d5261b58e97107fca610a868fbc283cbb8c856 (diff)
parentbb6663ca0a73872b063477e92272418b7d49e39b (diff)
downloadcmake-b84e9ae632ea78db87abca585785032c5b2b3e40.tar.gz
Merge branch 'mingw32-make-backslash-workaround' into release
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.h1
-rw-r--r--Source/cmMakefileTargetGenerator.cxx10
2 files changed, 11 insertions, 0 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h
index 4f2e4a0355..c9b9ccc70a 100644
--- a/Source/cmLocalUnixMakefileGenerator3.h
+++ b/Source/cmLocalUnixMakefileGenerator3.h
@@ -95,6 +95,7 @@ public:
* Set to true if the make tool being used is MinGW Make.
*/
void SetMinGWMake(bool v) {this->MinGWMake = v;}
+ bool IsMinGWMake() const { return this->MinGWMake; }
/**
* Set to true if the make tool being used is NMake.
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index ea11c79c07..b7e4e3722c 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -23,6 +23,7 @@
#include "cmComputeLinkInformation.h"
#include "cmCustomCommandGenerator.h"
#include "cmGeneratorExpression.h"
+#include "cmAlgorithms.h"
#include "cmMakefileExecutableTargetGenerator.h"
#include "cmMakefileLibraryTargetGenerator.h"
@@ -668,6 +669,15 @@ cmMakefileTargetGenerator
this->Convert(targetFullPathCompilePDB,
cmLocalGenerator::START_OUTPUT,
cmLocalGenerator::SHELL);
+
+ if (this->LocalGenerator->IsMinGWMake() &&
+ cmHasLiteralSuffix(targetOutPathCompilePDB, "\\"))
+ {
+ // mingw32-make incorrectly interprets 'a\ b c' as 'a b' and 'c'
+ // (but 'a\ b "c"' as 'a\', 'b', and 'c'!). Workaround this by
+ // avoiding a trailing backslash in the argument.
+ targetOutPathCompilePDB[targetOutPathCompilePDB.size()-1] = '/';
+ }
}
cmLocalGenerator::RuleVariables vars;
vars.RuleLauncher = "RULE_LAUNCH_COMPILE";