mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-16 05:26:58 +08:00
cmFindBaseDebugState: get the command name directly from the object
This commit is contained in:
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -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());
|
||||
|
@@ -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);
|
||||
|
@@ -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,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);
|
||||
|
Reference in New Issue
Block a user