summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileTargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-05-04 15:02:18 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-05-04 15:02:18 (GMT)
commit8403c8da2c54affb0ab185aaaf302c7fa7ade914 (patch)
tree271f558c80dd4b28e03c5d2621e6b940e3e78cb1 /Source/cmMakefileTargetGenerator.cxx
parente0222dda1490dcfdf85a18ea5a22ec2313ea4d53 (diff)
parentbb6663ca0a73872b063477e92272418b7d49e39b (diff)
downloadCMake-8403c8da2c54affb0ab185aaaf302c7fa7ade914.zip
CMake-8403c8da2c54affb0ab185aaaf302c7fa7ade914.tar.gz
CMake-8403c8da2c54affb0ab185aaaf302c7fa7ade914.tar.bz2
Merge topic 'mingw32-make-backslash-workaround'
bb6663ca Makefile: Workaround mingw32-make trailing backslash trouble (#15546)
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileTargetGenerator.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index d28dde1..a4dad1e 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -24,6 +24,7 @@
#include "cmComputeLinkInformation.h"
#include "cmCustomCommandGenerator.h"
#include "cmGeneratorExpression.h"
+#include "cmAlgorithms.h"
#include "cmMakefileExecutableTargetGenerator.h"
#include "cmMakefileLibraryTargetGenerator.h"
@@ -681,6 +682,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";