summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalNinjaGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-09-21 18:38:49 (GMT)
committerBrad King <brad.king@kitware.com>2016-09-22 17:52:03 (GMT)
commita57d1bb7122be79101cc17a4b8a04bd0ac5a041e (patch)
treed93b47452107019afc48878b86b5b4685df7838c /Source/cmGlobalNinjaGenerator.cxx
parent0488ae63ea8dfa8ac455e36b7cc41e81620a080f (diff)
downloadCMake-a57d1bb7122be79101cc17a4b8a04bd0ac5a041e.zip
CMake-a57d1bb7122be79101cc17a4b8a04bd0ac5a041e.tar.gz
CMake-a57d1bb7122be79101cc17a4b8a04bd0ac5a041e.tar.bz2
Ninja: Add API to check for dyndep support
Kitware maintains a branch of Ninja with support for dynamically discovered dependencies (dyndep) that has not yet been accepted upstream. Add an internal API to check whether the Ninja version in use for the build supports this feature.
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 77693fe..42ce622 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -475,6 +475,7 @@ cmGlobalNinjaGenerator::cmGlobalNinjaGenerator(cmake* cm)
, PolicyCMP0058(cmPolicies::WARN)
, NinjaSupportsConsolePool(false)
, NinjaSupportsImplicitOuts(false)
+ , NinjaSupportsDyndeps(0)
{
#ifdef _WIN32
cm->GetState()->SetWindowsShell(true);
@@ -572,6 +573,16 @@ void cmGlobalNinjaGenerator::CheckNinjaFeatures()
this->NinjaSupportsImplicitOuts = !cmSystemTools::VersionCompare(
cmSystemTools::OP_LESS, this->NinjaVersion.c_str(),
this->RequiredNinjaVersionForImplicitOuts().c_str());
+ {
+ // Our ninja branch adds ".dyndep-#" to its version number,
+ // where '#' is a feature-specific version number. Extract it.
+ static std::string const k_DYNDEP_ = ".dyndep-";
+ std::string::size_type pos = this->NinjaVersion.find(k_DYNDEP_);
+ if (pos != std::string::npos) {
+ const char* fv = this->NinjaVersion.c_str() + pos + k_DYNDEP_.size();
+ cmSystemTools::StringToULong(fv, &this->NinjaSupportsDyndeps);
+ }
+ }
}
bool cmGlobalNinjaGenerator::CheckLanguages(