Ninja: factor out the test for console pool support

This commit is contained in:
Peter Collingbourne 2014-11-05 21:40:14 +01:00 committed by Brad King
parent 4d1fedf46e
commit d5eae5563f
2 changed files with 10 additions and 3 deletions

View File

@ -1141,9 +1141,7 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os)
cmNinjaVars variables;
// Use 'console' pool to get non buffered output of the CMake re-run call
// Available since Ninja 1.5
if(cmSystemTools::VersionCompare(cmSystemTools::OP_LESS,
ninjaVersion().c_str(),
"1.5") == false)
if(SupportsConsolePool())
{
variables["pool"] = "console";
}
@ -1185,6 +1183,12 @@ std::string cmGlobalNinjaGenerator::ninjaVersion() const
return version;
}
bool cmGlobalNinjaGenerator::SupportsConsolePool() const
{
return cmSystemTools::VersionCompare(cmSystemTools::OP_LESS,
ninjaVersion().c_str(), "1.5") == false;
}
void cmGlobalNinjaGenerator::WriteTargetClean(std::ostream& os)
{
WriteRule(*this->RulesFileStream,

View File

@ -299,6 +299,9 @@ public:
virtual void ComputeTargetObjectDirectory(cmGeneratorTarget* gt) const;
std::string ninjaVersion() const;
bool SupportsConsolePool() const;
protected:
/// Overloaded methods. @see cmGlobalGenerator::Generate()