summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalNinjaGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-11-26 14:36:04 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-11-26 14:36:04 (GMT)
commit48e476c3f4baeccf17327560f34c8c403551f266 (patch)
treeb2a2e72c25a57c36f19a8d8ef71fa85cd666e9ef /Source/cmLocalNinjaGenerator.cxx
parente1fd64837d5bc2fcb425cf9ba24fc1d136e40bde (diff)
parentb6f1142c8b712fb5ebfd2515a400a0b5ac621a49 (diff)
downloadCMake-48e476c3f4baeccf17327560f34c8c403551f266.zip
CMake-48e476c3f4baeccf17327560f34c8c403551f266.tar.gz
CMake-48e476c3f4baeccf17327560f34c8c403551f266.tar.bz2
Merge topic 'ninja-quoted-cmd-commands'
b6f1142 Ninja: multiple commands must be quoted
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 158d714..c336762 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -292,16 +292,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();
}