Browse Source

Merge topic 'state-reset-glob'

6f3b9e8b95 cmState: Clear GlobVerificationManager state on Reset

Acked-by: Kitware Robot <[email protected]>
Merge-request: !2278
Brad King 7 years ago
parent
commit
7b148e7a30
3 changed files with 11 additions and 0 deletions
  1. 7 0
      Source/cmGlobVerificationManager.cxx
  2. 3 0
      Source/cmGlobVerificationManager.h
  3. 1 0
      Source/cmState.cxx

+ 7 - 0
Source/cmGlobVerificationManager.cxx

@@ -170,3 +170,10 @@ void cmGlobVerificationManager::AddCacheEntry(
     value.Backtraces.emplace_back(variable, backtrace);
   }
 }
+
+void cmGlobVerificationManager::Reset()
+{
+  this->Cache.clear();
+  this->VerifyScript.clear();
+  this->VerifyStamp.clear();
+}

+ 3 - 0
Source/cmGlobVerificationManager.h

@@ -37,6 +37,9 @@ protected:
                      const std::string& variable,
                      const cmListFileBacktrace& bt);
 
+  ///! Clear the glob cache for state reset.
+  void Reset();
+
   ///! Check targets should be written in generated build system.
   bool DoWriteVerifyTarget() const;
 

+ 1 - 0
Source/cmState.cxx

@@ -267,6 +267,7 @@ cmStateSnapshot cmState::Reset()
 {
   this->GlobalProperties.clear();
   this->PropertyDefinitions.clear();
+  this->GlobVerificationManager->Reset();
 
   cmStateDetail::PositionType pos = this->SnapshotData.Truncate();
   this->ExecutionListFiles.Truncate();