summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-08-01 17:41:26 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-08-23 15:08:54 (GMT)
commit6954c8936f52dcf7710e4b72b2e090b79bf38d1c (patch)
treec8a5ece825f63ee46d74de3332069c0d024ad99a /Source/cmMakefile.cxx
parent1fc645bd9cffb3170743de5c983f2407eeaaa086 (diff)
downloadCMake-6954c8936f52dcf7710e4b72b2e090b79bf38d1c.zip
CMake-6954c8936f52dcf7710e4b72b2e090b79bf38d1c.tar.gz
CMake-6954c8936f52dcf7710e4b72b2e090b79bf38d1c.tar.bz2
cmState: Add a VariableScope snapshot type.
Match the scopes currently used in cmMakefile for definitions.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index aef016e..1d02cfa 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -4464,6 +4464,17 @@ void cmMakefile::PushScope()
{
this->Internal->PushDefinitions(Internals::VariableScope);
+ std::string commandName;
+ long line = 0;
+ if (!this->ContextStack.empty())
+ {
+ commandName = this->ContextStack.back()->Name;
+ line = this->ContextStack.back()->Line;
+ }
+ this->StateSnapshot = this->GetState()->CreateVariableScopeSnapshot(
+ this->StateSnapshot,
+ commandName,
+ line);
this->PushLoopBlockBarrier();
#if defined(CMAKE_BUILD_WITH_CMAKE)
@@ -4482,6 +4493,9 @@ void cmMakefile::PopScope()
this->CheckForUnusedVariables();
this->Internal->PopDefinitions();
+ this->StateSnapshot =
+ this->GetState()->Pop(this->StateSnapshot);
+ assert(this->StateSnapshot.IsValid());
}
void cmMakefile::RaiseScope(const std::string& var, const char *varDef)