Przeglądaj źródła

Don't warn if the variable wasn't defined

Ben Boeckel 15 lat temu
rodzic
commit
995cfb0e2a
1 zmienionych plików z 6 dodań i 1 usunięć
  1. 6 1
      Source/cmMakefile.cxx

+ 6 - 1
Source/cmMakefile.cxx

@@ -1783,8 +1783,13 @@ void cmMakefile::CheckForUnused(const char* reason, const char* name) const
 void cmMakefile::RemoveDefinition(const char* name)
 {
   this->Internal->VarStack.top().Set(name, 0);
+  if (this->Internal->VarUsageStack.size() &&
+      this->VariableInitialized(name))
+    {
+    this->CheckForUnused("unsetting", name);
+    this->Internal->VarUsageStack.top().erase(name);
+    }
   this->Internal->VarInitStack.top().insert(name);
-  this->CheckForUnused("unsetting", name);
 #ifdef CMAKE_BUILD_WITH_CMAKE
   cmVariableWatch* vv = this->GetVariableWatch();
   if ( vv )