diff options
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 6 | ||||
-rw-r--r-- | Source/cmGlobalNinjaGenerator.h | 1 | ||||
-rw-r--r-- | Source/cmLocalNinjaGenerator.cxx | 1 | ||||
-rw-r--r-- | Source/cmNinjaUtilityTargetGenerator.cxx | 5 |
4 files changed, 13 insertions, 0 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 688eca4..60ab3e4 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -250,6 +250,7 @@ void cmGlobalNinjaGenerator::WriteCustomCommandBuild(const std::string& command, const std::string& description, const std::string& comment, + bool uses_terminal, const cmNinjaDeps& outputs, const cmNinjaDeps& deps, const cmNinjaDeps& orderOnly) @@ -266,6 +267,10 @@ cmGlobalNinjaGenerator::WriteCustomCommandBuild(const std::string& command, cmNinjaVars vars; vars["COMMAND"] = cmd; vars["DESC"] = EncodeLiteral(description); + if (uses_terminal && SupportsConsolePool()) + { + vars["pool"] = "console"; + } this->WriteBuild(*this->BuildFileStream, comment, @@ -826,6 +831,7 @@ void cmGlobalNinjaGenerator::WriteAssumedSourceDependencies() std::copy(i->second.begin(), i->second.end(), std::back_inserter(deps)); WriteCustomCommandBuild(/*command=*/"", /*description=*/"", "Assume dependencies for generated source file.", + /*uses_terminal*/false, cmNinjaDeps(1, i->first), deps); } } diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index 38b5ef5..a166938 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -103,6 +103,7 @@ public: void WriteCustomCommandBuild(const std::string& command, const std::string& description, const std::string& comment, + bool uses_terminal, const cmNinjaDeps& outputs, const cmNinjaDeps& deps = cmNinjaDeps(), const cmNinjaDeps& orderOnly = cmNinjaDeps()); diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index 9225f64..3c39b62 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -468,6 +468,7 @@ cmLocalNinjaGenerator::WriteCustomCommandBuildStatement( this->BuildCommandLine(cmdLines), this->ConstructComment(ccg), "Custom command for " + ninjaOutputs[0], + cc->GetUsesTerminal(), ninjaOutputs, ninjaDeps, orderOnlyDeps); diff --git a/Source/cmNinjaUtilityTargetGenerator.cxx b/Source/cmNinjaUtilityTargetGenerator.cxx index f5d18dc..c0a14ec 100644 --- a/Source/cmNinjaUtilityTargetGenerator.cxx +++ b/Source/cmNinjaUtilityTargetGenerator.cxx @@ -35,6 +35,8 @@ void cmNinjaUtilityTargetGenerator::Generate() &this->GetTarget()->GetPostBuildCommands() }; + bool uses_terminal = false; + for (unsigned i = 0; i != 2; ++i) { for (std::vector<cmCustomCommand>::const_iterator ci = cmdLists[i]->begin(); ci != cmdLists[i]->end(); ++ci) { @@ -42,6 +44,8 @@ void cmNinjaUtilityTargetGenerator::Generate() this->GetMakefile()); this->GetLocalGenerator()->AppendCustomCommandDeps(ccg, deps); this->GetLocalGenerator()->AppendCustomCommandLines(ccg, commands); + if (ci->GetUsesTerminal()) + uses_terminal = true; } } @@ -110,6 +114,7 @@ void cmNinjaUtilityTargetGenerator::Generate() command, desc, "Utility command for " + this->GetTargetName(), + uses_terminal, cmNinjaDeps(1, utilCommandName), deps); |