From 6bea84353c76d392a9da11557ab888fa18ea1955 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 24 Aug 2010 18:12:44 -0400 Subject: [PATCH] Factor out global generator ComputeTargetDepends method Put the global dependency analysis in its own method so individual generators can hook into this point. --- Source/cmGlobalGenerator.cxx | 28 ++++++++++++++++++---------- Source/cmGlobalGenerator.h | 2 ++ 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index bd26b5fca..bd0d199ad 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -863,19 +863,10 @@ void cmGlobalGenerator::Generate() } // Compute the inter-target dependencies. - { - cmComputeTargetDepends ctd(this); - if(!ctd.Compute()) + if(!this->ComputeTargetDepends()) { return; } - std::vector const& targets = ctd.GetTargets(); - for(std::vector::const_iterator ti = targets.begin(); - ti != targets.end(); ++ti) - { - ctd.GetTargetDirectDepends(*ti, this->TargetDependencies[*ti]); - } - } // Create a map from local generator to the complete set of targets // it builds by default. @@ -907,6 +898,23 @@ void cmGlobalGenerator::Generate() this->CMakeInstance->UpdateProgress("Generating done", -1); } +//---------------------------------------------------------------------------- +bool cmGlobalGenerator::ComputeTargetDepends() +{ + cmComputeTargetDepends ctd(this); + if(!ctd.Compute()) + { + return false; + } + std::vector const& targets = ctd.GetTargets(); + for(std::vector::const_iterator ti = targets.begin(); + ti != targets.end(); ++ti) + { + ctd.GetTargetDirectDepends(*ti, this->TargetDependencies[*ti]); + } + return true; +} + //---------------------------------------------------------------------------- bool cmGlobalGenerator::CheckTargets() { diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 878be1143..ea370877b 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -275,6 +275,8 @@ protected: void SetLanguageEnabledMaps(const char* l, cmMakefile* mf); void FillExtensionToLanguageMap(const char* l, cmMakefile* mf); + virtual bool ComputeTargetDepends(); + virtual bool CheckALLOW_DUPLICATE_CUSTOM_TARGETS(); bool CheckTargets();