diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2019-03-23 15:30:27 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2019-03-23 20:45:10 (GMT) |
commit | 5db17e9d8107629c1dabd0c1e2bf26429e5d841d (patch) | |
tree | 0c4c7a64ea203fd6cd44253346c60b0e89aa2e7b /Source | |
parent | ccf76c6e4cfd9fc7b04db099f7e165cda2336096 (diff) | |
download | CMake-5db17e9d8107629c1dabd0c1e2bf26429e5d841d.zip CMake-5db17e9d8107629c1dabd0c1e2bf26429e5d841d.tar.gz CMake-5db17e9d8107629c1dabd0c1e2bf26429e5d841d.tar.bz2 |
cmTarget: Move member `Name` to impl
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmTarget.cxx | 28 | ||||
-rw-r--r-- | Source/cmTarget.h | 3 |
2 files changed, 18 insertions, 13 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 6dd7887..ebf5e6d 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -168,6 +168,7 @@ public: cmStateEnums::TargetType TargetType; cmMakefile* Makefile; cmPolicies::PolicyMap PolicyMap; + std::string Name; cmPropertyMap Properties; std::set<BT<std::string>> Utilities; std::set<std::string> SystemIncludeDirectories; @@ -199,8 +200,8 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, assert(mf); impl->TargetType = type; impl->Makefile = mf; + impl->Name = name; this->IsGeneratorProvided = false; - this->Name = name; this->HaveInstallRule = false; this->DLLPlatform = false; this->IsAndroid = false; @@ -487,6 +488,11 @@ cmPolicies::PolicyMap const& cmTarget::GetPolicyMap() const return impl->PolicyMap; } +const std::string& cmTarget::GetName() const +{ + return impl->Name; +} + cmPolicies::PolicyStatus cmTarget::GetPolicyStatus( cmPolicies::PolicyID policy) const { @@ -800,7 +806,7 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf, std::string const& lib, (tgt && (tgt->GetType() == cmStateEnums::INTERFACE_LIBRARY || tgt->GetType() == cmStateEnums::OBJECT_LIBRARY)) || - (this->Name == lib)) { + (impl->Name == lib)) { return; } @@ -818,7 +824,7 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf, std::string const& lib, impl->TargetType <= cmStateEnums::MODULE_LIBRARY && (this->GetPolicyStatusCMP0073() == cmPolicies::OLD || this->GetPolicyStatusCMP0073() == cmPolicies::WARN)) { - std::string targetEntry = this->Name; + std::string targetEntry = impl->Name; targetEntry += "_LIB_DEPENDS"; std::string dependencies; const char* old_val = mf.GetDefinition(targetEntry); @@ -978,13 +984,13 @@ void cmTarget::SetProperty(const std::string& prop, const char* value) if (prop == propEXPORT_NAME && this->IsImported()) { std::ostringstream e; e << "EXPORT_NAME property can't be set on imported targets (\"" - << this->Name << "\")\n"; + << impl->Name << "\")\n"; impl->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str()); return; } if (prop == propSOURCES && this->IsImported()) { std::ostringstream e; - e << "SOURCES property can't be set on imported targets (\"" << this->Name + e << "SOURCES property can't be set on imported targets (\"" << impl->Name << "\")\n"; impl->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str()); return; @@ -992,7 +998,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value) if (prop == propIMPORTED_GLOBAL && !this->IsImported()) { std::ostringstream e; e << "IMPORTED_GLOBAL property can't be set on non-imported targets (\"" - << this->Name << "\")\n"; + << impl->Name << "\")\n"; impl->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str()); return; } @@ -1065,7 +1071,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value) if (!cmSystemTools::IsOn(value)) { std::ostringstream e; e << "IMPORTED_GLOBAL property can't be set to FALSE on targets (\"" - << this->Name << "\")\n"; + << impl->Name << "\")\n"; impl->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str()); return; } @@ -1082,7 +1088,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value) std::ostringstream e; e << "CUDA_PTX_COMPILATION property can only be applied to OBJECT " "targets (\"" - << this->Name << "\")\n"; + << impl->Name << "\")\n"; impl->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str()); return; } else { @@ -1107,13 +1113,13 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value, if (prop == "EXPORT_NAME" && this->IsImported()) { std::ostringstream e; e << "EXPORT_NAME property can't be set on imported targets (\"" - << this->Name << "\")\n"; + << impl->Name << "\")\n"; impl->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str()); return; } if (prop == "SOURCES" && this->IsImported()) { std::ostringstream e; - e << "SOURCES property can't be set on imported targets (\"" << this->Name + e << "SOURCES property can't be set on imported targets (\"" << impl->Name << "\")\n"; impl->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str()); return; @@ -1122,7 +1128,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value, std::ostringstream e; e << "IMPORTED_GLOBAL property can't be appended, only set on imported " "targets (\"" - << this->Name << "\")\n"; + << impl->Name << "\")\n"; impl->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str()); return; } diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 860a18e..f9dd83e 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -76,7 +76,7 @@ public: cmGlobalGenerator* GetGlobalGenerator() const; ///! Set/Get the name of the target - const std::string& GetName() const { return this->Name; } + const std::string& GetName() const; ///! Get the policy map cmPolicies::PolicyMap const& GetPolicyMap() const; @@ -297,7 +297,6 @@ private: private: bool IsGeneratorProvided; - std::string Name; std::string InstallPath; std::string RuntimeInstallPath; std::vector<cmCustomCommand> PreBuildCommands; |