summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-01-22 15:57:16 (GMT)
committerBrad King <brad.king@kitware.com>2009-01-22 15:57:16 (GMT)
commitdfc181a1dc0baa3b4f36b64a0b64e68c1a2f636a (patch)
tree4417f27921d73ef74d37a72031c39c2d1c2f873d /Source/cmMakefile.h
parentac14b5d2eb995f0cb1cfc1acca9d06ec02cff7d7 (diff)
downloadCMake-dfc181a1dc0baa3b4f36b64a0b64e68c1a2f636a.zip
CMake-dfc181a1dc0baa3b4f36b64a0b64e68c1a2f636a.tar.gz
CMake-dfc181a1dc0baa3b4f36b64a0b64e68c1a2f636a.tar.bz2
ENH: Create policy scope barriers
This creates a barrier mechanism to prevent user code from using cmake_policy(POP) to pop a scope it didn't push with cmake_policy(PUSH).
Diffstat (limited to 'Source/cmMakefile.h')
-rw-r--r--Source/cmMakefile.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 48dc768..b7b9dc7 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -351,9 +351,10 @@ public:
public:
PolicyPushPop(cmMakefile* m);
~PolicyPushPop();
+ void Quiet() { this->ReportError = false; }
private:
cmMakefile* Makefile;
- size_t PolicyDepth;
+ bool ReportError;
};
friend class PolicyPushPop;
@@ -942,9 +943,13 @@ private:
std::map<cmStdString, cmTarget*> ImportedTargets;
// Internal policy stack management.
- bool PushPolicy();
- bool PopPolicy(bool reportError = true);
+ void PushPolicy();
+ void PopPolicy();
+ void PushPolicyBarrier();
+ void PopPolicyBarrier(bool reportError = true);
friend class cmCMakePolicyCommand;
+ class IncludeScope;
+ friend class IncludeScope;
// stack of policy settings
struct PolicyStackEntry: public cmPolicies::PolicyMap
@@ -956,6 +961,7 @@ private:
};
typedef std::vector<PolicyStackEntry> PolicyStackType;
PolicyStackType PolicyStack;
+ std::vector<PolicyStackType::size_type> PolicyBarriers;
cmPolicies::PolicyStatus GetPolicyStatusInternal(cmPolicies::PolicyID id);
bool CheckCMP0000;