diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-10-22 23:13:36 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-10-27 06:44:21 (GMT) |
commit | 7d409f500e3403f8dbb4a0fee6ecdad94f45c35e (patch) | |
tree | 0a3704029d9b557be242067aec0ce5efe230c37e /Source | |
parent | 7a1b83cb3fc79639b9e2c1bf11af2d2274e4224a (diff) | |
download | CMake-7d409f500e3403f8dbb4a0fee6ecdad94f45c35e.zip CMake-7d409f500e3403f8dbb4a0fee6ecdad94f45c35e.tar.gz CMake-7d409f500e3403f8dbb4a0fee6ecdad94f45c35e.tar.bz2 |
cmLocalGenerator: Add GetPolicyStatus API
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGeneratorExpressionNode.cxx | 4 | ||||
-rw-r--r-- | Source/cmLocalGenerator.cxx | 10 | ||||
-rw-r--r-- | Source/cmLocalGenerator.h | 2 |
3 files changed, 12 insertions, 4 deletions
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index 7a7e4ff..03f8d3f 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx @@ -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"; diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index c37417d..5f0242e 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -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 { diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 552020b..6380db6 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -265,6 +265,8 @@ public: */ bool NeedBackwardsCompatibility_2_4(); + cmPolicies::PolicyStatus GetPolicyStatus(cmPolicies::PolicyID id) const; + cmake* GetCMakeInstance() const; const char* GetSourceDirectory() const; |