From d5eae5563f99fb28c99695fb4886f1bd40d98414 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Wed, 5 Nov 2014 21:40:14 +0100 Subject: Ninja: factor out the test for console pool support --- Source/cmGlobalNinjaGenerator.cxx | 10 +++++++--- Source/cmGlobalNinjaGenerator.h | 3 +++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 498ae9a..688eca4 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -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, diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index f666ee3..38b5ef5 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -299,6 +299,9 @@ public: virtual void ComputeTargetObjectDirectory(cmGeneratorTarget* gt) const; std::string ninjaVersion() const; + + bool SupportsConsolePool() const; + protected: /// Overloaded methods. @see cmGlobalGenerator::Generate() -- cgit v0.12