summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-01-22 18:16:27 (GMT)
committerBrad King <brad.king@kitware.com>2009-01-22 18:16:27 (GMT)
commit26bf8b2cda2f7aec429ac478c8ef1b9dbf436142 (patch)
tree5beae10e84662815dfc13bc3a6faab41fc747a94 /Source/cmMakefile.h
parent3a4f76949acb99b53380c738a25c7bae4ba317c9 (diff)
downloadCMake-26bf8b2cda2f7aec429ac478c8ef1b9dbf436142.zip
CMake-26bf8b2cda2f7aec429ac478c8ef1b9dbf436142.tar.gz
CMake-26bf8b2cda2f7aec429ac478c8ef1b9dbf436142.tar.bz2
ENH: Create notion of a 'weak' policy stack entry
A 'weak' poilcy stack entry responds normally to queries. However, setting a policy in a weak entry will recursively set the policy in the next entry too. This also gives the internal interface to create a weak entry the option to provide an initial PolicyMap for it.
Diffstat (limited to 'Source/cmMakefile.h')
-rw-r--r--Source/cmMakefile.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index b7b9dc7..a5fcec1 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -349,7 +349,9 @@ public:
class PolicyPushPop
{
public:
- PolicyPushPop(cmMakefile* m);
+ PolicyPushPop(cmMakefile* m,
+ bool weak = false,
+ cmPolicies::PolicyMap const& pm = cmPolicies::PolicyMap());
~PolicyPushPop();
void Quiet() { this->ReportError = false; }
private:
@@ -943,7 +945,8 @@ private:
std::map<cmStdString, cmTarget*> ImportedTargets;
// Internal policy stack management.
- void PushPolicy();
+ void PushPolicy(bool weak = false,
+ cmPolicies::PolicyMap const& pm = cmPolicies::PolicyMap());
void PopPolicy();
void PushPolicyBarrier();
void PopPolicyBarrier(bool reportError = true);
@@ -955,9 +958,10 @@ private:
struct PolicyStackEntry: public cmPolicies::PolicyMap
{
typedef cmPolicies::PolicyMap derived;
- PolicyStackEntry(): derived() {}
- PolicyStackEntry(derived const& d): derived(d) {}
- PolicyStackEntry(PolicyStackEntry const& r): derived(r) {}
+ PolicyStackEntry(bool w = false): derived(), Weak(w) {}
+ PolicyStackEntry(derived const& d, bool w = false): derived(d), Weak(w) {}
+ PolicyStackEntry(PolicyStackEntry const& r): derived(r), Weak(r.Weak) {}
+ bool Weak;
};
typedef std::vector<PolicyStackEntry> PolicyStackType;
PolicyStackType PolicyStack;