diff options
author | Brad King <brad.king@kitware.com> | 2009-01-22 18:16:47 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-01-22 18:16:47 (GMT) |
commit | 3028ca756c8621b3cc37032987eb01fbe61da248 (patch) | |
tree | 1a32991d7d25cefaa5b214759d84ab2c20a3c0b5 /Source/cmMakefile.cxx | |
parent | 18eadebc4c0b43443861f40ca243e18dbabb2324 (diff) | |
download | CMake-3028ca756c8621b3cc37032987eb01fbe61da248.zip CMake-3028ca756c8621b3cc37032987eb01fbe61da248.tar.gz CMake-3028ca756c8621b3cc37032987eb01fbe61da248.tar.bz2 |
ENH: Better policies for functions and macros
This teaches functions and macros to use policies recorded at creation
time when they are invoked. It restores the policies as a weak policy
stack entry so that any policies set by a function escape to its caller
as before.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 25d97fa..4442bd3 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -3774,3 +3774,15 @@ cmPolicies *cmMakefile::GetPolicies() } return this->GetCMakeInstance()->GetPolicies(); } + +//---------------------------------------------------------------------------- +void cmMakefile::RecordPolicies(cmPolicies::PolicyMap& pm) +{ + /* Record the setting of every policy. */ + typedef cmPolicies::PolicyID PolicyID; + for(PolicyID pid = cmPolicies::CMP0000; + pid != cmPolicies::CMPCOUNT; pid = PolicyID(pid+1)) + { + pm[pid] = this->GetPolicyStatus(pid); + } +} |