summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-07-06 00:00:32 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-07-25 12:48:36 (GMT)
commitf4a25874a2cb5468e7ecce6812e5833e10943017 (patch)
treeff473aa5ed98e502ffdfb22e9a406d14dc8ab53b
parent3c45471c2d4a0c08b88f10161d4b166a27165e31 (diff)
downloadCMake-f4a25874a2cb5468e7ecce6812e5833e10943017.zip
CMake-f4a25874a2cb5468e7ecce6812e5833e10943017.tar.gz
CMake-f4a25874a2cb5468e7ecce6812e5833e10943017.tar.bz2
cmMakefile: Inline internal policy status method.
-rw-r--r--Source/cmMakefile.cxx47
-rw-r--r--Source/cmMakefile.h2
2 files changed, 18 insertions, 31 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index cae7bbc..7a35a26 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -4742,34 +4742,6 @@ const char* cmMakefile::GetDefineFlagsCMP0059() const
cmPolicies::PolicyStatus
cmMakefile::GetPolicyStatus(cmPolicies::PolicyID id) const
{
- // Get the current setting of the policy.
- cmPolicies::PolicyStatus cur = this->GetPolicyStatusInternal(id);
-
- // If the policy is required to be set to NEW but is not, ignore the
- // current setting and tell the caller.
- if(cur != cmPolicies::NEW)
- {
- if(cur == cmPolicies::REQUIRED_ALWAYS ||
- cur == cmPolicies::REQUIRED_IF_USED)
- {
- return cur;
- }
- cmPolicies::PolicyStatus def = cmPolicies::GetPolicyStatus(id);
- if(def == cmPolicies::REQUIRED_ALWAYS ||
- def == cmPolicies::REQUIRED_IF_USED)
- {
- return def;
- }
- }
-
- // The current setting is okay.
- return cur;
-}
-
-//----------------------------------------------------------------------------
-cmPolicies::PolicyStatus
-cmMakefile::GetPolicyStatusInternal(cmPolicies::PolicyID id) const
-{
cmPolicies::PolicyStatus status = cmPolicies::GetPolicyStatus(id);
cmLocalGenerator* lg = this->LocalGenerator;
while(lg)
@@ -4787,7 +4759,24 @@ cmMakefile::GetPolicyStatusInternal(cmPolicies::PolicyID id) const
lg = lg->GetParent();
}
- // The policy is not set. Use the default for this CMake version.
+ // If the policy is required to be set to NEW but is not, ignore the
+ // current setting and tell the caller.
+ if(status != cmPolicies::NEW)
+ {
+ if(status == cmPolicies::REQUIRED_ALWAYS ||
+ status == cmPolicies::REQUIRED_IF_USED)
+ {
+ return status;
+ }
+ cmPolicies::PolicyStatus def = cmPolicies::GetPolicyStatus(id);
+ if(def == cmPolicies::REQUIRED_ALWAYS ||
+ def == cmPolicies::REQUIRED_IF_USED)
+ {
+ return def;
+ }
+ }
+
+ // The current setting is okay.
return status;
}
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 2fc4d78..6dbea89 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -938,8 +938,6 @@ private:
typedef std::vector<PolicyStackEntry> PolicyStackType;
PolicyStackType PolicyStack;
std::vector<PolicyStackType::size_type> PolicyBarriers;
- cmPolicies::PolicyStatus
- GetPolicyStatusInternal(cmPolicies::PolicyID id) const;
// CMP0053 == old
cmake::MessageType ExpandVariablesInStringOld(