Commit 217c243d authored by Stephen Kelly's avatar Stephen Kelly
Browse files

cmake: Update the current snapshot when Resetting.

This will matter when definitions are stored in the cmState.
parent eb05dcd6
...@@ -219,13 +219,13 @@ void cmState::RemoveCacheEntryProperty(std::string const& key, ...@@ -219,13 +219,13 @@ void cmState::RemoveCacheEntryProperty(std::string const& key,
->GetCacheIterator(key.c_str()).SetProperty(propertyName, (void*)0); ->GetCacheIterator(key.c_str()).SetProperty(propertyName, (void*)0);
} }
void cmState::Reset() cmState::Snapshot cmState::Reset()
{ {
this->GlobalProperties.clear(); this->GlobalProperties.clear();
this->PropertyDefinitions.clear(); this->PropertyDefinitions.clear();
this->BuildsystemDirectory.Truncate(); this->BuildsystemDirectory.Truncate();
this->SnapshotData.Truncate(); PositionType pos = this->SnapshotData.Truncate();
this->DefineProperty this->DefineProperty
("RULE_LAUNCH_COMPILE", cmProperty::DIRECTORY, ("RULE_LAUNCH_COMPILE", cmProperty::DIRECTORY,
...@@ -246,6 +246,8 @@ void cmState::Reset() ...@@ -246,6 +246,8 @@ void cmState::Reset()
this->DefineProperty this->DefineProperty
("RULE_LAUNCH_CUSTOM", cmProperty::TARGET, ("RULE_LAUNCH_CUSTOM", cmProperty::TARGET,
"", "", true); "", "", true);
return Snapshot(this, pos);
} }
void cmState::DefineProperty(const std::string& name, void cmState::DefineProperty(const std::string& name,
......
...@@ -105,7 +105,7 @@ public: ...@@ -105,7 +105,7 @@ public:
void RemoveCacheEntryProperty(std::string const& key, void RemoveCacheEntryProperty(std::string const& key,
std::string const& propertyName); std::string const& propertyName);
void Reset(); Snapshot Reset();
// Define a property // Define a property
void DefineProperty(const std::string& name, cmProperty::ScopeType scope, void DefineProperty(const std::string& name, cmProperty::ScopeType scope,
const char *ShortDescription, const char *ShortDescription,
......
...@@ -186,7 +186,7 @@ cmake::~cmake() ...@@ -186,7 +186,7 @@ cmake::~cmake()
void cmake::CleanupCommandsAndMacros() void cmake::CleanupCommandsAndMacros()
{ {
this->State->Reset(); this->CurrentSnapshot = this->State->Reset();
this->State->RemoveUserDefinedCommands(); this->State->RemoveUserDefinedCommands();
} }
...@@ -370,6 +370,7 @@ void cmake::ReadListFile(const std::vector<std::string>& args, ...@@ -370,6 +370,7 @@ void cmake::ReadListFile(const std::vector<std::string>& args,
// read in the list file to fill the cache // read in the list file to fill the cache
if(path) if(path)
{ {
this->CurrentSnapshot = this->State->Reset();
std::string homeDir = this->GetHomeDirectory(); std::string homeDir = this->GetHomeDirectory();
std::string homeOutputDir = this->GetHomeOutputDirectory(); std::string homeOutputDir = this->GetHomeOutputDirectory();
this->SetHomeDirectory(cmSystemTools::GetCurrentWorkingDirectory()); this->SetHomeDirectory(cmSystemTools::GetCurrentWorkingDirectory());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment