diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-08-01 05:20:26 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-08-02 06:56:57 (GMT) |
commit | 52dbe654dea7562564be9d880540e6bc706998ba (patch) | |
tree | d57c3e1028d0260e38e04c238f1d6e8bdbe3238c /Source | |
parent | 65a5e0c671fc7d42525a6279aebf9a74de2c97a7 (diff) | |
download | CMake-52dbe654dea7562564be9d880540e6bc706998ba.zip CMake-52dbe654dea7562564be9d880540e6bc706998ba.tar.gz CMake-52dbe654dea7562564be9d880540e6bc706998ba.tar.bz2 |
cmState: Record the end position of each directory.
At generate time, variables and policies are determined from the end
state of the cmMakefile.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmState.cxx | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/Source/cmState.cxx b/Source/cmState.cxx index 09446bb..1d24ec6 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -34,6 +34,8 @@ struct cmState::SnapshotDataType struct cmState::BuildsystemDirectoryStateType { + cmState::PositionType DirectoryEnd; + std::string Location; std::string OutputLocation; @@ -239,6 +241,9 @@ cmState::Snapshot cmState::Reset() this->GlobalProperties.clear(); this->PropertyDefinitions.clear(); + PositionType pos = this->SnapshotData.Truncate(); + this->ExecutionListFiles.Truncate(); + { cmLinkedTree<BuildsystemDirectoryStateType>::iterator it = this->BuildsystemDirectory.Truncate(); @@ -248,9 +253,8 @@ cmState::Snapshot cmState::Reset() it->CompileDefinitionsBacktraces.clear(); it->CompileOptions.clear(); it->CompileOptionsBacktraces.clear(); + it->DirectoryEnd = pos; } - PositionType pos = this->SnapshotData.Truncate(); - this->ExecutionListFiles.Truncate(); this->DefineProperty ("RULE_LAUNCH_COMPILE", cmProperty::DIRECTORY, @@ -721,6 +725,7 @@ cmState::Snapshot cmState::CreateBaseSnapshot() pos->IncludeDirectoryPosition = 0; pos->CompileDefinitionsPosition = 0; pos->CompileOptionsPosition = 0; + pos->BuildSystemDirectory->DirectoryEnd = pos; return cmState::Snapshot(this, pos); } @@ -741,6 +746,7 @@ cmState::CreateBuildsystemDirectorySnapshot(Snapshot originSnapshot, pos->ExecutionListFile = this->ExecutionListFiles.Extend( originSnapshot.Position->ExecutionListFile); + pos->BuildSystemDirectory->DirectoryEnd = pos; return cmState::Snapshot(this, pos); } @@ -757,6 +763,7 @@ cmState::CreateFunctionCallSnapshot(cmState::Snapshot originSnapshot, pos->SnapshotType = FunctionCallType; pos->ExecutionListFile = this->ExecutionListFiles.Extend( originSnapshot.Position->ExecutionListFile, fileName); + pos->BuildSystemDirectory->DirectoryEnd = pos; return cmState::Snapshot(this, pos); } @@ -774,6 +781,7 @@ cmState::CreateMacroCallSnapshot(cmState::Snapshot originSnapshot, pos->SnapshotType = MacroCallType; pos->ExecutionListFile = this->ExecutionListFiles.Extend( originSnapshot.Position->ExecutionListFile, fileName); + pos->BuildSystemDirectory->DirectoryEnd = pos; return cmState::Snapshot(this, pos); } @@ -790,6 +798,7 @@ cmState::CreateCallStackSnapshot(cmState::Snapshot originSnapshot, pos->SnapshotType = CallStackType; pos->ExecutionListFile = this->ExecutionListFiles.Extend( originSnapshot.Position->ExecutionListFile, fileName); + pos->BuildSystemDirectory->DirectoryEnd = pos; return cmState::Snapshot(this, pos); } @@ -806,6 +815,7 @@ cmState::CreateInlineListFileSnapshot(cmState::Snapshot originSnapshot, pos->SnapshotType = InlineListFileType; pos->ExecutionListFile = this->ExecutionListFiles.Extend( originSnapshot.Position->ExecutionListFile, fileName); + pos->BuildSystemDirectory->DirectoryEnd = pos; return cmState::Snapshot(this, pos); } @@ -815,6 +825,7 @@ cmState::CreatePolicyScopeSnapshot(cmState::Snapshot originSnapshot) PositionType pos = this->SnapshotData.Extend(originSnapshot.Position, *originSnapshot.Position); pos->SnapshotType = PolicyScopeType; + pos->BuildSystemDirectory->DirectoryEnd = pos; return cmState::Snapshot(this, pos); } @@ -829,6 +840,7 @@ cmState::Snapshot cmState::Pop(cmState::Snapshot originSnapshot) prevPos->BuildSystemDirectory->CompileDefinitions.size(); prevPos->CompileOptionsPosition = prevPos->BuildSystemDirectory->CompileOptions.size(); + prevPos->BuildSystemDirectory->DirectoryEnd = prevPos; return Snapshot(this, prevPos); } |