Factor out global generator ComputeTargetDepends method

Put the global dependency analysis in its own method so individual
generators can hook into this point.
This commit is contained in:
Brad King 2010-08-24 18:12:44 -04:00
parent e752cff8fd
commit 6bea84353c
2 changed files with 20 additions and 10 deletions

View File

@ -863,19 +863,10 @@ void cmGlobalGenerator::Generate()
} }
// Compute the inter-target dependencies. // Compute the inter-target dependencies.
{ if(!this->ComputeTargetDepends())
cmComputeTargetDepends ctd(this);
if(!ctd.Compute())
{ {
return; return;
} }
std::vector<cmTarget*> const& targets = ctd.GetTargets();
for(std::vector<cmTarget*>::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 // Create a map from local generator to the complete set of targets
// it builds by default. // it builds by default.
@ -907,6 +898,23 @@ void cmGlobalGenerator::Generate()
this->CMakeInstance->UpdateProgress("Generating done", -1); this->CMakeInstance->UpdateProgress("Generating done", -1);
} }
//----------------------------------------------------------------------------
bool cmGlobalGenerator::ComputeTargetDepends()
{
cmComputeTargetDepends ctd(this);
if(!ctd.Compute())
{
return false;
}
std::vector<cmTarget*> const& targets = ctd.GetTargets();
for(std::vector<cmTarget*>::const_iterator ti = targets.begin();
ti != targets.end(); ++ti)
{
ctd.GetTargetDirectDepends(*ti, this->TargetDependencies[*ti]);
}
return true;
}
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmGlobalGenerator::CheckTargets() bool cmGlobalGenerator::CheckTargets()
{ {

View File

@ -275,6 +275,8 @@ protected:
void SetLanguageEnabledMaps(const char* l, cmMakefile* mf); void SetLanguageEnabledMaps(const char* l, cmMakefile* mf);
void FillExtensionToLanguageMap(const char* l, cmMakefile* mf); void FillExtensionToLanguageMap(const char* l, cmMakefile* mf);
virtual bool ComputeTargetDepends();
virtual bool CheckALLOW_DUPLICATE_CUSTOM_TARGETS(); virtual bool CheckALLOW_DUPLICATE_CUSTOM_TARGETS();
bool CheckTargets(); bool CheckTargets();