1
0
Эх сурвалжийг харах

ENH: Make policy push/pop methods private

This makes cmMakefile::PushPolicy and cmMakefile::PopPolicy private so
that any outside place that uses them needs to use the PolicyPushPop
helper in an automatic variable.  We grant an exception to
cmCMakePolicyCommand so it can implement cmake_policy(PUSH) and
cmake_policy(POP).
Brad King 17 жил өмнө
parent
commit
ac14b5d2eb
1 өөрчлөгдсөн 7 нэмэгдсэн , 3 устгасан
  1. 7 3
      Source/cmMakefile.h

+ 7 - 3
Source/cmMakefile.h

@@ -44,6 +44,7 @@ class cmTest;
 class cmVariableWatch;
 class cmake;
 class cmMakefileCall;
+class cmCMakePolicyCommand;
 
 /** \class cmMakefile
  * \brief Process the input CMakeLists.txt file.
@@ -341,8 +342,6 @@ public:
   bool SetPolicy(cmPolicies::PolicyID id, cmPolicies::PolicyStatus status);
   bool SetPolicy(const char *id, cmPolicies::PolicyStatus status);
   cmPolicies::PolicyStatus GetPolicyStatus(cmPolicies::PolicyID id);
-  bool PushPolicy();
-  bool PopPolicy(bool reportError = true);
   bool SetPolicyVersion(const char *version);
   //@}
 
@@ -941,7 +940,12 @@ private:
   cmTarget* FindBasicTarget(const char* name);
   std::vector<cmTarget*> ImportedTargetsOwned;
   std::map<cmStdString, cmTarget*> ImportedTargets;
-  
+
+  // Internal policy stack management.
+  bool PushPolicy();
+  bool PopPolicy(bool reportError = true);
+  friend class cmCMakePolicyCommand;
+
   // stack of policy settings
   struct PolicyStackEntry: public cmPolicies::PolicyMap
   {