parent
b541b1213a
commit
8e45c1128c
|
@ -495,9 +495,9 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile *mf,
|
||||||
std::string ver = "2.4.0";
|
std::string ver = "2.4.0";
|
||||||
|
|
||||||
if (version && strlen(version) > 0)
|
if (version && strlen(version) > 0)
|
||||||
{
|
{
|
||||||
ver = version;
|
ver = version;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int majorVer = 2;
|
unsigned int majorVer = 2;
|
||||||
unsigned int minorVer = 0;
|
unsigned int minorVer = 0;
|
||||||
|
@ -556,29 +556,28 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile *mf,
|
||||||
|
|
||||||
// now loop over all the policies and set them as appropriate
|
// now loop over all the policies and set them as appropriate
|
||||||
std::vector<cmPolicies::PolicyID> ancientPolicies;
|
std::vector<cmPolicies::PolicyID> ancientPolicies;
|
||||||
std::map<cmPolicies::PolicyID,cmPolicy *>::iterator i
|
for(std::map<cmPolicies::PolicyID,cmPolicy *>::iterator i
|
||||||
= this->Policies.begin();
|
= this->Policies.begin(); i != this->Policies.end(); ++i)
|
||||||
for (;i != this->Policies.end(); ++i)
|
|
||||||
{
|
|
||||||
if (i->second->IsPolicyNewerThan(majorVer,minorVer,patchVer,tweakVer))
|
|
||||||
{
|
{
|
||||||
|
if (i->second->IsPolicyNewerThan(majorVer,minorVer,patchVer,tweakVer))
|
||||||
|
{
|
||||||
if(i->second->Status == cmPolicies::REQUIRED_ALWAYS)
|
if(i->second->Status == cmPolicies::REQUIRED_ALWAYS)
|
||||||
{
|
{
|
||||||
ancientPolicies.push_back(i->first);
|
ancientPolicies.push_back(i->first);
|
||||||
}
|
}
|
||||||
else if (!mf->SetPolicy(i->second->ID, cmPolicies::WARN))
|
else if (!mf->SetPolicy(i->second->ID, cmPolicies::WARN))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
if (!mf->SetPolicy(i->second->ID, cmPolicies::NEW))
|
|
||||||
{
|
{
|
||||||
|
if (!mf->SetPolicy(i->second->ID, cmPolicies::NEW))
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Make sure the project does not use any ancient policies.
|
// Make sure the project does not use any ancient policies.
|
||||||
if(!ancientPolicies.empty())
|
if(!ancientPolicies.empty())
|
||||||
|
|
Loading…
Reference in New Issue