mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 21:31:08 -06: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:
@@ -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