cmLocalGenerator: Add GetPolicyStatus API
This commit is contained in:
parent
7a1b83cb3f
commit
7d409f500e
@ -393,7 +393,7 @@ struct CompilerIdNode : public cmGeneratorExpressionNode
|
||||
|
||||
if (cmsysString_strcasecmp(parameters.begin()->c_str(), compilerId) == 0)
|
||||
{
|
||||
switch(context->LG->GetMakefile()->GetPolicyStatus(cmPolicies::CMP0044))
|
||||
switch(context->LG->GetPolicyStatus(cmPolicies::CMP0044))
|
||||
{
|
||||
case cmPolicies::WARN:
|
||||
{
|
||||
@ -1100,7 +1100,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
|
||||
"COMPILE_DEFINITIONS_"))
|
||||
{
|
||||
cmPolicies::PolicyStatus polSt =
|
||||
context->LG->GetMakefile()->GetPolicyStatus(cmPolicies::CMP0043);
|
||||
context->LG->GetPolicyStatus(cmPolicies::CMP0043);
|
||||
if (polSt == cmPolicies::WARN || polSt == cmPolicies::OLD)
|
||||
{
|
||||
interfacePropertyName = "INTERFACE_COMPILE_DEFINITIONS";
|
||||
|
@ -2201,7 +2201,7 @@ bool cmLocalGenerator::GetShouldUseOldFlags(bool shared,
|
||||
|
||||
if (flags && flags != originalFlags)
|
||||
{
|
||||
switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0018))
|
||||
switch (this->GetPolicyStatus(cmPolicies::CMP0018))
|
||||
{
|
||||
case cmPolicies::WARN:
|
||||
{
|
||||
@ -2949,7 +2949,7 @@ bool cmLocalGenerator::NeedBackwardsCompatibility_2_4()
|
||||
{
|
||||
// Check the policy to decide whether to pay attention to this
|
||||
// variable.
|
||||
switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0001))
|
||||
switch(this->GetPolicyStatus(cmPolicies::CMP0001))
|
||||
{
|
||||
case cmPolicies::WARN:
|
||||
// WARN is just OLD without warning because user code does not
|
||||
@ -2976,6 +2976,12 @@ bool cmLocalGenerator::NeedBackwardsCompatibility_2_4()
|
||||
actual_compat <= CMake_VERSION_ENCODE(2, 4, 255));
|
||||
}
|
||||
|
||||
cmPolicies::PolicyStatus
|
||||
cmLocalGenerator::GetPolicyStatus(cmPolicies::PolicyID id) const
|
||||
{
|
||||
return this->Makefile->GetPolicyStatus(id);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool cmLocalGenerator::CheckDefinition(std::string const& define) const
|
||||
{
|
||||
|
@ -265,6 +265,8 @@ public:
|
||||
*/
|
||||
bool NeedBackwardsCompatibility_2_4();
|
||||
|
||||
cmPolicies::PolicyStatus GetPolicyStatus(cmPolicies::PolicyID id) const;
|
||||
|
||||
cmake* GetCMakeInstance() const;
|
||||
|
||||
const char* GetSourceDirectory() const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user