From 3c09bf0fa7139be0215224ef85a4c2d3c38227f0 Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann Date: Sat, 23 Mar 2019 15:45:44 +0100 Subject: cmTarget: Move member `Utilities` to impl --- Source/cmTarget.cxx | 16 +++++++++++----- Source/cmTarget.h | 11 ++++------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 1638c64..8244c84 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -168,6 +168,7 @@ public: cmStateEnums::TargetType TargetType; cmMakefile* Makefile; cmPropertyMap Properties; + std::set> Utilities; std::set SystemIncludeDirectories; std::vector IncludeDirectoriesEntries; std::vector IncludeDirectoriesBacktraces; @@ -481,10 +482,15 @@ cmGlobalGenerator* cmTarget::GetGlobalGenerator() const return impl->Makefile->GetGlobalGenerator(); } -void cmTarget::AddUtility(std::string const& u, cmMakefile* mf) +void cmTarget::AddUtility(std::string const& name, cmMakefile* mf) { - BT util(u, mf ? mf->GetBacktrace() : cmListFileBacktrace()); - this->Utilities.insert(util); + impl->Utilities.insert( + BT(name, mf ? mf->GetBacktrace() : cmListFileBacktrace())); +} + +std::set> const& cmTarget::GetUtilities() const +{ + return impl->Utilities; } cmListFileBacktrace const& cmTarget::GetBacktrace() const @@ -1461,12 +1467,12 @@ const char* cmTarget::GetProperty(const std::string& prop) const return output.c_str(); } if (prop == propMANUALLY_ADDED_DEPENDENCIES) { - if (this->Utilities.empty()) { + if (impl->Utilities.empty()) { return nullptr; } static std::string output; - output = cmJoin(this->Utilities, ";"); + output = cmJoin(impl->Utilities, ";"); return output.c_str(); } if (prop == propIMPORTED) { diff --git a/Source/cmTarget.h b/Source/cmTarget.h index dca3dd4..f552d23 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -184,16 +184,14 @@ public: bool GetIsGeneratorProvided() const { return this->IsGeneratorProvided; } void SetIsGeneratorProvided(bool igp) { this->IsGeneratorProvided = igp; } - /** Add a utility on which this project depends. A utility is an executable + /** + * Add a utility on which this project depends. A utility is an executable * name as would be specified to the ADD_EXECUTABLE or UTILITY_SOURCE * commands. It is not a full path nor does it have an extension. */ - void AddUtility(std::string const& u, cmMakefile* mf = nullptr); + void AddUtility(std::string const& name, cmMakefile* mf = nullptr); ///! Get the utilities used by this target - std::set> const& GetUtilities() const - { - return this->Utilities; - } + std::set> const& GetUtilities() const; ///! Set/Get a property of this target file void SetProperty(const std::string& prop, const char* value); @@ -301,7 +299,6 @@ private: private: bool IsGeneratorProvided; - std::set> Utilities; cmPolicies::PolicyMap PolicyMap; std::string Name; std::string InstallPath; -- cgit v0.12