summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalNinjaGenerator.cxx
diff options
context:
space:
mode:
authorPeter Kümmel <syntheticpp@gmx.net>2013-11-25 10:17:14 (GMT)
committerPeter Kümmel <syntheticpp@gmx.net>2013-11-25 11:08:10 (GMT)
commitb6f1142c8b712fb5ebfd2515a400a0b5ac621a49 (patch)
tree3fc3a1ff1c64174fd882ebf9dd34449158f16ad8 /Source/cmLocalNinjaGenerator.cxx
parentac2acd22dd98172af52034e59db9d1652033dd37 (diff)
downloadCMake-b6f1142c8b712fb5ebfd2515a400a0b5ac621a49.zip
CMake-b6f1142c8b712fb5ebfd2515a400a0b5ac621a49.tar.gz
CMake-b6f1142c8b712fb5ebfd2515a400a0b5ac621a49.tar.bz2
Ninja: multiple commands must be quoted
Bug 14370
Diffstat (limited to 'Source/cmLocalNinjaGenerator.cxx')
-rw-r--r--Source/cmLocalNinjaGenerator.cxx30
1 files changed, 23 insertions, 7 deletions
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index f1d5e2c..84d89df 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -287,16 +287,32 @@ std::string cmLocalNinjaGenerator::BuildCommandLine(
cmOStringStream cmd;
for (std::vector<std::string>::const_iterator li = cmdLines.begin();
- li != cmdLines.end(); ++li) {
- if (li != cmdLines.begin()) {
- cmd << " && ";
+ li != cmdLines.end(); ++li)
#ifdef _WIN32
- } else if (cmdLines.size() > 1) {
- cmd << "cmd.exe /c ";
-#endif
+ {
+ if (li != cmdLines.begin())
+ {
+ cmd << " && ";
+ }
+ else if (cmdLines.size() > 1)
+ {
+ cmd << "cmd.exe /C \"";
+ }
+ cmd << *li;
}
+ if (cmdLines.size() > 1)
+ {
+ cmd << "\"";
+ }
+#else
+ {
+ if (li != cmdLines.begin())
+ {
+ cmd << " && ";
+ }
cmd << *li;
- }
+ }
+#endif
return cmd.str();
}