From 3b3ecdfa4872a86dcb8eb7d5f5478259890d4707 Mon Sep 17 00:00:00 2001 From: Nicolas Despres Date: Fri, 13 May 2016 23:42:02 +0200 Subject: Ninja: Pre-compute "all" build target name --- Source/cmGlobalNinjaGenerator.cxx | 6 ++++-- Source/cmGlobalNinjaGenerator.h | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index a8e02e1..864cd2b 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -488,6 +488,8 @@ void cmGlobalNinjaGenerator::Generate() this->OpenBuildFileStream(); this->OpenRulesFileStream(); + this->TargetAll = "all"; + this->PolicyCMP0058 = this->LocalGenerators[0]->GetMakefile()->GetPolicyStatus( cmPolicies::CMP0058); @@ -1059,7 +1061,7 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os) // should all match now. std::vector unknownExplicitDepends; - this->CombinedCustomCommandExplicitDependencies.erase("all"); + this->CombinedCustomCommandExplicitDependencies.erase(this->TargetAll); std::set_difference(this->CombinedCustomCommandExplicitDependencies.begin(), this->CombinedCustomCommandExplicitDependencies.end(), @@ -1125,7 +1127,7 @@ void cmGlobalNinjaGenerator::WriteBuiltinTargets(std::ostream& os) void cmGlobalNinjaGenerator::WriteTargetAll(std::ostream& os) { cmNinjaDeps outputs; - outputs.push_back("all"); + outputs.push_back(this->TargetAll); this->WritePhonyBuild(os, "The main all target.", outputs, this->AllDependencies); diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index 881104f..151950b 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -397,6 +397,9 @@ private: std::string NinjaCommand; std::string NinjaVersion; + +private: + std::string TargetAll; }; #endif // ! cmGlobalNinjaGenerator_h -- cgit v0.12