| 1037 | } |
| 1038 | |
| 1039 | cmStateSnapshot cmState::Pop(cmStateSnapshot const& originSnapshot) |
| 1040 | { |
| 1041 | cmStateDetail::PositionType pos = originSnapshot.Position; |
| 1042 | cmStateDetail::PositionType prevPos = pos; |
| 1043 | ++prevPos; |
| 1044 | prevPos->IncludeDirectoryPosition = |
| 1045 | prevPos->BuildSystemDirectory->IncludeDirectories.size(); |
| 1046 | prevPos->CompileDefinitionsPosition = |
| 1047 | prevPos->BuildSystemDirectory->CompileDefinitions.size(); |
| 1048 | prevPos->CompileOptionsPosition = |
| 1049 | prevPos->BuildSystemDirectory->CompileOptions.size(); |
| 1050 | prevPos->LinkOptionsPosition = |
| 1051 | prevPos->BuildSystemDirectory->LinkOptions.size(); |
| 1052 | prevPos->LinkDirectoriesPosition = |
| 1053 | prevPos->BuildSystemDirectory->LinkDirectories.size(); |
| 1054 | prevPos->BuildSystemDirectory->CurrentScope = prevPos; |
| 1055 | prevPos->UnwindState = pos->UnwindState; |
| 1056 | |
| 1057 | if (!pos->Keep && this->SnapshotData.IsLast(pos)) { |
| 1058 | if (pos->Vars != prevPos->Vars) { |
| 1059 | assert(this->VarTree.IsLast(pos->Vars)); |
| 1060 | this->VarTree.Pop(pos->Vars); |
| 1061 | } |
| 1062 | if (pos->ExecutionListFile != prevPos->ExecutionListFile) { |
| 1063 | assert(this->ExecutionListFiles.IsLast(pos->ExecutionListFile)); |
| 1064 | this->ExecutionListFiles.Pop(pos->ExecutionListFile); |
| 1065 | } |
| 1066 | this->SnapshotData.Pop(pos); |
| 1067 | } |
| 1068 | |
| 1069 | return { this, prevPos }; |
| 1070 | } |
| 1071 | |
| 1072 | static bool ParseEntryWithoutType(std::string const& entry, std::string& var, |
| 1073 | std::string& value) |