Sfoglia il codice sorgente

Add a method to put a watch for variables

Ben Boeckel 15 anni fa
parent
commit
33c63b19ab
2 ha cambiato i file con 10 aggiunte e 4 eliminazioni
  1. 9 4
      Source/cmake.cxx
  2. 1 0
      Source/cmake.h

+ 9 - 4
Source/cmake.cxx

@@ -380,10 +380,7 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
           "No help, variable specified on the command line.", type);
           "No help, variable specified on the command line.", type);
         if(this->WarnUnusedCli)
         if(this->WarnUnusedCli)
           {
           {
-#ifdef CMAKE_BUILD_WITH_CMAKE
-          this->VariableWatch->AddWatch(var, cmWarnUnusedCliWarning, this);
-          this->UsedCliVariables[var] = false;
-#endif
+          this->WatchUnusedCli(var.c_str());
           }
           }
         }
         }
       else
       else
@@ -4488,6 +4485,14 @@ int cmake::Build(const std::string& dir,
                     0, nativeOptions);
                     0, nativeOptions);
 }
 }
 
 
+void cmake::WatchUnusedCli(const char* var)
+{
+#ifdef CMAKE_BUILD_WITH_CMAKE
+  this->VariableWatch->AddWatch(var, cmWarnUnusedCliWarning, this);
+  this->UsedCliVariables[var] = false;
+#endif
+}
+
 void cmake::RunCheckForUnusedVariables() const
 void cmake::RunCheckForUnusedVariables() const
 {
 {
 #ifdef CMAKE_BUILD_WITH_CMAKE
 #ifdef CMAKE_BUILD_WITH_CMAKE

+ 1 - 0
Source/cmake.h

@@ -363,6 +363,7 @@ class cmake
             const std::vector<std::string>& nativeOptions,
             const std::vector<std::string>& nativeOptions,
             bool clean);
             bool clean);
 
 
+  void WatchUnusedCli(const char* var);
   void RunCheckForUnusedVariables() const;
   void RunCheckForUnusedVariables() const;
 protected:
 protected:
   void InitializeProperties();
   void InitializeProperties();