mirror of
https://github.com/reactos/CMake.git
synced 2024-11-29 14:30:27 +00:00
cmMakefile: Move CMP0059 handling to command code.
Don't pay a penalty for it in all GetProperty calls. Additionally, the storage of properties will eventually move to cmState, which should only contain state and not logic for policies like this.
This commit is contained in:
parent
fe603c7dfb
commit
52b9d828ab
@ -86,6 +86,23 @@ bool cmGetDirectoryPropertyCommand
|
||||
const char *prop = 0;
|
||||
if (!i->empty())
|
||||
{
|
||||
if (*i == "DEFINITIONS")
|
||||
{
|
||||
switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0059))
|
||||
{
|
||||
case cmPolicies::WARN:
|
||||
this->Makefile->IssueMessage(cmake::AUTHOR_WARNING,
|
||||
cmPolicies::GetPolicyWarning(cmPolicies::CMP0059));
|
||||
case cmPolicies::OLD:
|
||||
this->StoreResult(variable,
|
||||
this->Makefile->GetDefineFlagsCMP0059());
|
||||
return true;
|
||||
case cmPolicies::NEW:
|
||||
case cmPolicies::REQUIRED_ALWAYS:
|
||||
case cmPolicies::REQUIRED_IF_USED:
|
||||
break;
|
||||
}
|
||||
}
|
||||
prop = dir->GetProperty(*i);
|
||||
}
|
||||
this->StoreResult(variable, prop);
|
||||
|
@ -279,6 +279,22 @@ bool cmGetPropertyCommand::HandleDirectoryMode()
|
||||
}
|
||||
}
|
||||
|
||||
if (this->PropertyName == "DEFINITIONS")
|
||||
{
|
||||
switch(mf->GetPolicyStatus(cmPolicies::CMP0059))
|
||||
{
|
||||
case cmPolicies::WARN:
|
||||
mf->IssueMessage(cmake::AUTHOR_WARNING,
|
||||
cmPolicies::GetPolicyWarning(cmPolicies::CMP0059));
|
||||
case cmPolicies::OLD:
|
||||
return this->StoreResult(mf->GetDefineFlagsCMP0059());
|
||||
case cmPolicies::NEW:
|
||||
case cmPolicies::REQUIRED_ALWAYS:
|
||||
case cmPolicies::REQUIRED_IF_USED:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Get the property.
|
||||
return this->StoreResult(mf->GetProperty(this->PropertyName));
|
||||
}
|
||||
|
@ -4171,22 +4171,6 @@ const char *cmMakefile::GetProperty(const std::string& prop,
|
||||
this->GetListOfMacros(output);
|
||||
return output.c_str();
|
||||
}
|
||||
else if (prop == "DEFINITIONS")
|
||||
{
|
||||
switch(this->GetPolicyStatus(cmPolicies::CMP0059))
|
||||
{
|
||||
case cmPolicies::WARN:
|
||||
this->IssueMessage(cmake::AUTHOR_WARNING, cmPolicies::
|
||||
GetPolicyWarning(cmPolicies::CMP0059));
|
||||
case cmPolicies::OLD:
|
||||
output += this->DefineFlagsOrig;
|
||||
return output.c_str();
|
||||
case cmPolicies::NEW:
|
||||
case cmPolicies::REQUIRED_ALWAYS:
|
||||
case cmPolicies::REQUIRED_IF_USED:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (prop == "LINK_DIRECTORIES")
|
||||
{
|
||||
output = cmJoin(this->GetLinkDirectories(), ";");
|
||||
@ -4674,6 +4658,11 @@ cmState::Snapshot cmMakefile::GetStateSnapshot() const
|
||||
return this->StateSnapshot;
|
||||
}
|
||||
|
||||
const char* cmMakefile::GetDefineFlagsCMP0059() const
|
||||
{
|
||||
return this->DefineFlagsOrig.c_str();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
cmPolicies::PolicyStatus
|
||||
cmMakefile::GetPolicyStatus(cmPolicies::PolicyID id) const
|
||||
|
@ -838,6 +838,8 @@ public:
|
||||
|
||||
cmState::Snapshot GetStateSnapshot() const;
|
||||
|
||||
const char* GetDefineFlagsCMP0059() const;
|
||||
|
||||
protected:
|
||||
// add link libraries and directories to the target
|
||||
void AddGlobalLinkInformation(const std::string& name, cmTarget& target);
|
||||
|
Loading…
Reference in New Issue
Block a user