summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 4f2e4a0..c9b9ccc 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 ea11c79..b7e4e37 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";