diff options
author | Peter Kümmel <syntheticpp@gmx.net> | 2013-11-25 10:17:14 (GMT) |
---|---|---|
committer | Peter Kümmel <syntheticpp@gmx.net> | 2013-11-25 11:08:10 (GMT) |
commit | b6f1142c8b712fb5ebfd2515a400a0b5ac621a49 (patch) | |
tree | 3fc3a1ff1c64174fd882ebf9dd34449158f16ad8 /Source/cmLocalNinjaGenerator.cxx | |
parent | ac2acd22dd98172af52034e59db9d1652033dd37 (diff) | |
download | CMake-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.cxx | 30 |
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(); } |