summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalNinjaGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmLocalNinjaGenerator.cxx')
-rw-r--r--Source/cmLocalNinjaGenerator.cxx18
1 files changed, 10 insertions, 8 deletions
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index 425b219..9a496f2 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -46,7 +46,9 @@ void cmLocalNinjaGenerator::Generate()
this->SetConfigName();
this->WriteProcessedMakefile(this->GetBuildFileStream());
+#ifdef NINJA_GEN_VERBOSE_FILES
this->WriteProcessedMakefile(this->GetRulesFileStream());
+#endif
this->WriteBuildFileTop();
@@ -275,16 +277,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;
+ cmOStringStream 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();
@@ -299,7 +301,7 @@ void cmLocalNinjaGenerator::AppendCustomCommandLines(const cmCustomCommand *cc,
if (!wd)
wd = this->GetMakefile()->GetStartOutputDirectory();
- std::ostringstream cdCmd;
+ cmOStringStream cdCmd;
cdCmd << "cd " << this->ConvertToOutputFormat(wd, SHELL);
cmdLines.push_back(cdCmd.str());
}