mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-10-11 23:43:58 +03:00
cmState: Improve how state is reset
Modify cmState::Reset to create a fresh BuildsystemDirectoryStateType for the root, rather than trying to reset the old one. This is less brittle with respect to changes made to BuildsystemDirectoryStateType (e.g. adding new members).
This commit is contained in:
1 parent
1063a1c603
commit
acaae6d265
1 file changed
+6
-10
+6
-10
@@ -282,16 +282,12 @@ cmStateSnapshot cmState::Reset()
|
||||
{
|
||||
cmLinkedTree<cmStateDetail::BuildsystemDirectoryStateType>::iterator it =
|
||||
this->BuildsystemDirectory.Truncate();
|
||||
it->IncludeDirectories.clear();
|
||||
it->CompileDefinitions.clear();
|
||||
it->CompileOptions.clear();
|
||||
it->LinkOptions.clear();
|
||||
it->LinkDirectories.clear();
|
||||
it->CurrentScope = pos;
|
||||
it->NormalTargetNames.clear();
|
||||
it->ImportedTargetNames.clear();
|
||||
it->Properties.Clear();
|
||||
it->Children.clear();
|
||||
|
||||
cmStateDetail::BuildsystemDirectoryStateType newState;
|
||||
newState.Location = std::move(it->Location);
|
||||
newState.OutputLocation = std::move(it->OutputLocation);
|
||||
newState.CurrentScope = pos;
|
||||
*it = std::move(newState);
|
||||
}
|
||||
|
||||
this->PolicyStack.Clear();
|
||||
|
||||
Reference in new issue
Block a user