summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-05-24 11:00:20 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-05-24 11:30:24 (GMT)
commit01e1cd5c1fc5e2684ec69d4916dd31ed23746055 (patch)
tree554d47feea8bc7a28abb753df88ab108c9997c9b /Source/cmake.cxx
parentf69dcdfc380176a2c4365357c1ca85c0444087b0 (diff)
downloadCMake-01e1cd5c1fc5e2684ec69d4916dd31ed23746055.zip
CMake-01e1cd5c1fc5e2684ec69d4916dd31ed23746055.tar.gz
CMake-01e1cd5c1fc5e2684ec69d4916dd31ed23746055.tar.bz2
cmState: Move snapshot creation to the cmake instance.
Don't create a snapshot in Initialize(), but leave the creation responsibility to the cmake instance instead. Previously, the cmState would Initialize() in its constructor, and the cmake instance would re-Initialize() during Configure(). The end result was the same and there would be one snapshot present. However, cmLocalGenerator also created a snapshot on construction, and that one was used, leaving the first snapshot unused, and potential for off-by-one errors. Fix that by making the cmLocalGenerator use the existing snapshot if it is top-level. Add a CurrentSnapshot to the cmake instance and populated it while configuring a directory. This will eventually replace the 'current local generator' concept. Fix the GetParent implementation to be able to return the first snapshot.
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 1c9842e..3ef85b6 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -134,6 +134,7 @@ cmake::cmake()
this->Policies = new cmPolicies();
this->State = new cmState(this);
+ this->CurrentSnapshot = this->State->CreateSnapshot(cmState::Snapshot());
#ifdef __APPLE__
struct rlimit rlp;
@@ -185,7 +186,7 @@ cmake::~cmake()
void cmake::CleanupCommandsAndMacros()
{
- this->State->Initialize();
+ this->State->Reset();
this->State->RemoveUserDefinedCommands();
}