diff options
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index b5d976a..7012701 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1562,6 +1562,26 @@ void cmMakefile::InitializeFromParent() this->ImportedTargets = parent->ImportedTargets; } +void cmMakefile::PushFunctionScope(const cmPolicies::PolicyMap& pm) +{ + this->PushScope(); + + this->PushFunctionBlockerBarrier(); + + this->PushPolicy(true, pm); + this->PushPolicyBarrier(); +} + +void cmMakefile::PopFunctionScope(bool reportError) +{ + this->PopPolicyBarrier(reportError); + this->PopPolicy(); + + this->PopFunctionBlockerBarrier(reportError); + + this->PopScope(); +} + //---------------------------------------------------------------------------- class cmMakefileCurrent { @@ -5418,3 +5438,16 @@ AddRequiredTargetCFeature(cmTarget *target, const std::string& feature) const } return true; } + + +cmMakefile::FunctionPushPop::FunctionPushPop(cmMakefile* mf, + cmPolicies::PolicyMap const& pm) + : Makefile(mf), ReportError(true) +{ + this->Makefile->PushFunctionScope(pm); +} + +cmMakefile::FunctionPushPop::~FunctionPushPop() +{ + this->Makefile->PopFunctionScope(this->ReportError); +} |