瀏覽代碼

cmFindBaseDebugState: get the command name directly from the object

Ben Boeckel 6 月之前
父節點
當前提交
76ea613f4c
共有 5 個文件被更改,包括 13 次插入17 次删除
  1. 2 3
      Source/cmFindBase.cxx
  2. 1 1
      Source/cmFindBase.h
  3. 5 6
      Source/cmFindLibraryCommand.cxx
  4. 1 1
      Source/cmFindPathCommand.cxx
  5. 4 6
      Source/cmFindProgramCommand.cxx

+ 2 - 3
Source/cmFindBase.cxx

@@ -634,10 +634,9 @@ void cmFindBase::StoreFindResult(std::string const& value)
   }
 }
 
-cmFindBaseDebugState::cmFindBaseDebugState(std::string commandName,
-                                           cmFindBase const* findBase)
+cmFindBaseDebugState::cmFindBaseDebugState(cmFindBase const* findBase)
   : FindCommand(findBase)
-  , CommandName(std::move(commandName))
+  , CommandName(findBase->FindCommandName)
 {
 }
 

+ 1 - 1
Source/cmFindBase.h

@@ -95,7 +95,7 @@ private:
 class cmFindBaseDebugState
 {
 public:
-  explicit cmFindBaseDebugState(std::string name, cmFindBase const* findBase);
+  explicit cmFindBaseDebugState(cmFindBase const* findBase);
   ~cmFindBaseDebugState();
 
   void FoundAt(std::string const& path, std::string regexName = std::string());

+ 5 - 6
Source/cmFindLibraryCommand.cxx

@@ -191,8 +191,7 @@ std::string cmFindLibraryCommand::FindLibrary()
 
 struct cmFindLibraryHelper
 {
-  cmFindLibraryHelper(std::string debugName, cmMakefile* mf,
-                      cmFindBase const* findBase);
+  cmFindLibraryHelper(cmMakefile* mf, cmFindBase const* findBase);
 
   // Context information.
   cmMakefile* Makefile;
@@ -306,12 +305,12 @@ std::string const& get_suffixes(cmMakefile* mf)
   return (suffixProp) ? *suffixProp : defaultSuffix;
 }
 }
-cmFindLibraryHelper::cmFindLibraryHelper(std::string debugName, cmMakefile* mf,
+cmFindLibraryHelper::cmFindLibraryHelper(cmMakefile* mf,
                                          cmFindBase const* base)
   : Makefile(mf)
   , FindBase(base)
   , DebugMode(base->DebugModeEnabled())
-  , DebugSearches(std::move(debugName), base)
+  , DebugSearches(base)
 {
   this->GG = this->Makefile->GetGlobalGenerator();
 
@@ -540,7 +539,7 @@ std::string cmFindLibraryCommand::FindNormalLibrary()
 std::string cmFindLibraryCommand::FindNormalLibraryNamesPerDir()
 {
   // Search for all names in each directory.
-  cmFindLibraryHelper helper(this->FindCommandName, this->Makefile, this);
+  cmFindLibraryHelper helper(this->Makefile, this);
   for (std::string const& n : this->Names) {
     helper.AddName(n);
   }
@@ -557,7 +556,7 @@ std::string cmFindLibraryCommand::FindNormalLibraryNamesPerDir()
 std::string cmFindLibraryCommand::FindNormalLibraryDirsPerName()
 {
   // Search the entire path for each name.
-  cmFindLibraryHelper helper(this->FindCommandName, this->Makefile, this);
+  cmFindLibraryHelper helper(this->Makefile, this);
   for (std::string const& n : this->Names) {
     // Switch to searching for this name.
     helper.SetName(n);

+ 1 - 1
Source/cmFindPathCommand.cxx

@@ -49,7 +49,7 @@ bool cmFindPathCommand::InitialPass(std::vector<std::string> const& argsIn)
 
 std::string cmFindPathCommand::FindHeader()
 {
-  cmFindBaseDebugState debug(this->FindCommandName, this);
+  cmFindBaseDebugState debug(this);
   std::string header;
   if (this->SearchFrameworkFirst || this->SearchFrameworkOnly) {
     header = this->FindFrameworkHeader(debug);

+ 4 - 6
Source/cmFindProgramCommand.cxx

@@ -4,7 +4,6 @@
 
 #include <algorithm>
 #include <string>
-#include <utility>
 
 #include "cmMakefile.h"
 #include "cmMessageType.h"
@@ -25,9 +24,8 @@ class cmExecutionStatus;
 
 struct cmFindProgramHelper
 {
-  cmFindProgramHelper(std::string debugName, cmMakefile* makefile,
-                      cmFindBase const* base)
-    : DebugSearches(std::move(debugName), base)
+  cmFindProgramHelper(cmMakefile* makefile, cmFindBase const* base)
+    : DebugSearches(base)
     , Makefile(makefile)
     , FindBase(base)
     , PolicyCMP0109(makefile->GetPolicyStatus(cmPolicies::CMP0109))
@@ -233,7 +231,7 @@ std::string cmFindProgramCommand::FindNormalProgram()
 std::string cmFindProgramCommand::FindNormalProgramNamesPerDir()
 {
   // Search for all names in each directory.
-  cmFindProgramHelper helper(this->FindCommandName, this->Makefile, this);
+  cmFindProgramHelper helper(this->Makefile, this);
   for (std::string const& n : this->Names) {
     helper.AddName(n);
   }
@@ -256,7 +254,7 @@ std::string cmFindProgramCommand::FindNormalProgramNamesPerDir()
 std::string cmFindProgramCommand::FindNormalProgramDirsPerName()
 {
   // Search the entire path for each name.
-  cmFindProgramHelper helper(this->FindCommandName, this->Makefile, this);
+  cmFindProgramHelper helper(this->Makefile, this);
   for (std::string const& n : this->Names) {
     // Switch to searching for this name.
     helper.SetName(n);