summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-05-30 22:18:33 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-06-02 23:14:33 (GMT)
commitda28f11523644cdc2138a0cde2c4c015948ff46c (patch)
tree8448e145a4236a96bb8685fc4ac4711e82aae6ec /Source
parentd3bb5da9294ddbfcc5fddf7ba3dafd2c3e0b32b2 (diff)
downloadCMake-da28f11523644cdc2138a0cde2c4c015948ff46c.zip
CMake-da28f11523644cdc2138a0cde2c4c015948ff46c.tar.gz
CMake-da28f11523644cdc2138a0cde2c4c015948ff46c.tar.bz2
cmState: Add CreateBaseSnapshot method.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmState.cxx18
-rw-r--r--Source/cmState.h1
-rw-r--r--Source/cmake.cxx2
3 files changed, 16 insertions, 5 deletions
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index 58885d3..eade817 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -659,12 +659,22 @@ void cmState::Snapshot::ComputeRelativePathTopBinary()
}
}
+cmState::Snapshot cmState::CreateBaseSnapshot()
+{
+ PositionType pos = 0;
+ this->ParentPositions.push_back(pos);
+ this->Locations.resize(1);
+ this->OutputLocations.resize(1);
+ this->CurrentSourceDirectoryComponents.resize(1);
+ this->CurrentBinaryDirectoryComponents.resize(1);
+ this->RelativePathTopSource.resize(1);
+ this->RelativePathTopBinary.resize(1);
+ return cmState::Snapshot(this, pos);
+}
+
cmState::Snapshot cmState::CreateSnapshot(Snapshot originSnapshot)
{
- if (!originSnapshot.IsValid())
- {
- originSnapshot.State = this;
- }
+ assert(originSnapshot.IsValid());
PositionType pos = this->ParentPositions.size();
this->ParentPositions.push_back(originSnapshot.Position);
this->Locations.resize(this->Locations.size() + 1);
diff --git a/Source/cmState.h b/Source/cmState.h
index 77a066f..157bd90 100644
--- a/Source/cmState.h
+++ b/Source/cmState.h
@@ -57,6 +57,7 @@ public:
cmState::PositionType Position;
};
+ Snapshot CreateBaseSnapshot();
Snapshot CreateSnapshot(Snapshot originSnapshot);
enum CacheEntryType{ BOOL=0, PATH, FILEPATH, STRING, INTERNAL,STATIC,
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 23803ef..ee5d53c 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -134,7 +134,7 @@ cmake::cmake()
this->Policies = new cmPolicies();
this->State = new cmState(this);
- this->CurrentSnapshot = this->State->CreateSnapshot(cmState::Snapshot());
+ this->CurrentSnapshot = this->State->CreateBaseSnapshot();
#ifdef __APPLE__
struct rlimit rlp;