From 0397c92a15e505021d75eb0a156a312b024eb85e Mon Sep 17 00:00:00 2001 From: Nicolas Despres Date: Fri, 13 May 2016 23:44:25 +0200 Subject: Ninja: Pre-compute "CMakeCache.txt" build target name --- Source/cmGlobalNinjaGenerator.cxx | 5 +++-- Source/cmGlobalNinjaGenerator.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 864cd2b..df5a001 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -489,6 +489,7 @@ void cmGlobalNinjaGenerator::Generate() this->OpenRulesFileStream(); this->TargetAll = "all"; + this->CMakeCacheFile = "CMakeCache.txt"; this->PolicyCMP0058 = this->LocalGenerators[0]->GetMakefile()->GetPolicyStatus( @@ -1040,7 +1041,7 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os) } } } - knownDependencies.insert("CMakeCache.txt"); + knownDependencies.insert(this->CMakeCacheFile); for (TargetAliasMap::const_iterator i = this->TargetAliases.begin(); i != this->TargetAliases.end(); ++i) { @@ -1168,7 +1169,7 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os) implicitDeps.push_back(this->ConvertToNinjaPath(*fi)); } } - implicitDeps.push_back("CMakeCache.txt"); + implicitDeps.push_back(this->CMakeCacheFile); std::sort(implicitDeps.begin(), implicitDeps.end()); implicitDeps.erase(std::unique(implicitDeps.begin(), implicitDeps.end()), diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index 151950b..28034f6 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -400,6 +400,7 @@ private: private: std::string TargetAll; + std::string CMakeCacheFile; }; #endif // ! cmGlobalNinjaGenerator_h -- cgit v0.12