summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalNinjaGenerator.cxx
diff options
context:
space:
mode:
authorPeter Kuemmel <syntheticpp@gmx.net>2012-06-05 20:39:42 (GMT)
committerPeter Kuemmel <syntheticpp@gmx.net>2012-06-05 20:39:42 (GMT)
commitad4a768d59bc1d224ef097ff0724b8d5bfaa8128 (patch)
tree051e0a8357ad015a13bb28e6c850a450d1b9566d /Source/cmLocalNinjaGenerator.cxx
parent7687d557dc9a04c56ca9d9e943ff8e21ac8eb028 (diff)
downloadCMake-ad4a768d59bc1d224ef097ff0724b8d5bfaa8128.zip
CMake-ad4a768d59bc1d224ef097ff0724b8d5bfaa8128.tar.gz
CMake-ad4a768d59bc1d224ef097ff0724b8d5bfaa8128.tar.bz2
Ninja: add response file support on Windows
When MinGW is used slashes are used for dependencies because ar.exe can't read rsp files with backslashes. Many thx to Claus Klein for starting working on this.
Diffstat (limited to 'Source/cmLocalNinjaGenerator.cxx')
-rw-r--r--Source/cmLocalNinjaGenerator.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index 425b219..a0141cf 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -275,16 +275,16 @@ std::string cmLocalNinjaGenerator::BuildCommandLine(
return ":";
#endif
- // TODO: This will work only on Unix platforms. I don't
- // want to use a link.txt file because I will lose the benefit of the
- // $in variables. A discussion about dealing with multiple commands in
- // a rule is started here:
- // groups.google.com/group/ninja-build/browse_thread/thread/d515f23a78986008
std::ostringstream cmd;
for (std::vector<std::string>::const_iterator li = cmdLines.begin();
li != cmdLines.end(); ++li) {
- if (li != cmdLines.begin())
+ if (li != cmdLines.begin()) {
cmd << " && ";
+#ifdef _WIN32
+ } else if (cmdLines.size() > 1) {
+ cmd << "cmd.exe /c ";
+#endif
+ }
cmd << *li;
}
return cmd.str();