From 2c14eb4852924e5423d58785e2cb3bcd72af7710 Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann Date: Sat, 23 Mar 2019 16:03:55 +0100 Subject: cmTarget: Move member `PolicyMap` to impl --- Source/cmTarget.cxx | 16 ++++++++++++++-- Source/cmTarget.h | 9 +++++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 596fd15..be03e56 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -167,6 +167,7 @@ class cmTargetInternals public: cmStateEnums::TargetType TargetType; cmMakefile* Makefile; + cmPolicies::PolicyMap PolicyMap; cmPropertyMap Properties; std::set> Utilities; std::set SystemIncludeDirectories; @@ -422,14 +423,14 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, } // Record current policies for later use. - impl->Makefile->RecordPolicies(this->PolicyMap); + impl->Makefile->RecordPolicies(impl->PolicyMap); if (impl->TargetType == cmStateEnums::INTERFACE_LIBRARY) { // This policy is checked in a few conditions. The properties relevant // to the policy are always ignored for cmStateEnums::INTERFACE_LIBRARY // targets, // so ensure that the conditions don't lead to nonsense. - this->PolicyMap.Set(cmPolicies::CMP0022, cmPolicies::NEW); + impl->PolicyMap.Set(cmPolicies::CMP0022, cmPolicies::NEW); } if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY && @@ -478,6 +479,17 @@ cmMakefile* cmTarget::GetMakefile() const return impl->Makefile; } +cmPolicies::PolicyMap const& cmTarget::GetPolicyMap() const +{ + return impl->PolicyMap; +} + +cmPolicies::PolicyStatus cmTarget::GetPolicyStatus( + cmPolicies::PolicyID policy) const +{ + return impl->PolicyMap.Get(policy); +} + cmGlobalGenerator* cmTarget::GetGlobalGenerator() const { return impl->Makefile->GetGlobalGenerator(); diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 33439fa..ca9a31d 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -78,10 +78,16 @@ public: ///! Set/Get the name of the target const std::string& GetName() const { return this->Name; } + ///! Get the policy map + cmPolicies::PolicyMap const& GetPolicyMap() const; + + ///! Get policy status + cmPolicies::PolicyStatus GetPolicyStatus(cmPolicies::PolicyID policy) const; + #define DECLARE_TARGET_POLICY(POLICY) \ cmPolicies::PolicyStatus GetPolicyStatus##POLICY() const \ { \ - return this->PolicyMap.Get(cmPolicies::POLICY); \ + return this->GetPolicyStatus(cmPolicies::POLICY); \ } CM_FOR_EACH_TARGET_POLICY(DECLARE_TARGET_POLICY) @@ -291,7 +297,6 @@ private: private: bool IsGeneratorProvided; - cmPolicies::PolicyMap PolicyMap; std::string Name; std::string InstallPath; std::string RuntimeInstallPath; -- cgit v0.12