cmMakefile::VariablePushPop: helper class to manage variable scopes
This commit is contained in:
parent
3d94ee0e03
commit
604993248f
@ -4543,6 +4543,19 @@ bool cmMakefile::SetPolicyVersion(std::string const& version_min,
|
||||
cmPolicies::WarnCompat::On);
|
||||
}
|
||||
|
||||
cmMakefile::VariablePushPop::VariablePushPop(cmMakefile* m)
|
||||
: Makefile(m)
|
||||
{
|
||||
this->Makefile->StateSnapshot =
|
||||
this->Makefile->GetState()->CreateVariableScopeSnapshot(
|
||||
this->Makefile->StateSnapshot);
|
||||
}
|
||||
|
||||
cmMakefile::VariablePushPop::~VariablePushPop()
|
||||
{
|
||||
this->Makefile->PopSnapshot();
|
||||
}
|
||||
|
||||
bool cmMakefile::HasCMP0054AlreadyBeenReported(
|
||||
cmListFileContext const& context) const
|
||||
{
|
||||
|
@ -376,6 +376,20 @@ public:
|
||||
};
|
||||
friend class PolicyPushPop;
|
||||
|
||||
/** Helper class to push and pop variables scopes automatically. */
|
||||
class VariablePushPop
|
||||
{
|
||||
public:
|
||||
VariablePushPop(cmMakefile* m);
|
||||
~VariablePushPop();
|
||||
|
||||
VariablePushPop(VariablePushPop const&) = delete;
|
||||
VariablePushPop& operator=(VariablePushPop const&) = delete;
|
||||
|
||||
private:
|
||||
cmMakefile* Makefile;
|
||||
};
|
||||
|
||||
/**
|
||||
* Determine if the given context, name pair has already been reported
|
||||
* in context of CMP0054.
|
||||
|
Loading…
Reference in New Issue
Block a user