cmMakefile: Convert recursion to loop.
This commit is contained in:
parent
e00e8713de
commit
84e1805666
|
@ -4770,21 +4770,19 @@ cmMakefile::GetPolicyStatus(cmPolicies::PolicyID id) const
|
||||||
cmPolicies::PolicyStatus
|
cmPolicies::PolicyStatus
|
||||||
cmMakefile::GetPolicyStatusInternal(cmPolicies::PolicyID id) const
|
cmMakefile::GetPolicyStatusInternal(cmPolicies::PolicyID id) const
|
||||||
{
|
{
|
||||||
// Is the policy set in our stack?
|
cmLocalGenerator* lg = this->LocalGenerator;
|
||||||
for(PolicyStackType::const_reverse_iterator psi = this->PolicyStack.rbegin();
|
while(lg)
|
||||||
psi != this->PolicyStack.rend(); ++psi)
|
{
|
||||||
|
cmMakefile const* mf = lg->GetMakefile();
|
||||||
|
for(PolicyStackType::const_reverse_iterator psi =
|
||||||
|
mf->PolicyStack.rbegin(); psi != mf->PolicyStack.rend(); ++psi)
|
||||||
{
|
{
|
||||||
if(psi->IsDefined(id))
|
if(psi->IsDefined(id))
|
||||||
{
|
{
|
||||||
return psi->Get(id);
|
return psi->Get(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
lg = lg->GetParent();
|
||||||
// If we have a parent directory, recurse up to it.
|
|
||||||
if(this->LocalGenerator->GetParent())
|
|
||||||
{
|
|
||||||
cmMakefile* parent = this->LocalGenerator->GetParent()->GetMakefile();
|
|
||||||
return parent->GetPolicyStatusInternal(id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// The policy is not set. Use the default for this CMake version.
|
// The policy is not set. Use the default for this CMake version.
|
||||||
|
|
Loading…
Reference in New Issue