summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2019-03-23 15:03:55 (GMT)
committerSebastian Holtermann <sebholt@xwmw.org>2019-03-23 20:45:09 (GMT)
commit2c14eb4852924e5423d58785e2cb3bcd72af7710 (patch)
tree943034a2c523fade5c17e5e200b917e96c2c5883
parentf6241db3e0b69fbf99835b955b17be0f253a742f (diff)
downloadCMake-2c14eb4852924e5423d58785e2cb3bcd72af7710.zip
CMake-2c14eb4852924e5423d58785e2cb3bcd72af7710.tar.gz
CMake-2c14eb4852924e5423d58785e2cb3bcd72af7710.tar.bz2
cmTarget: Move member `PolicyMap` to impl
-rw-r--r--Source/cmTarget.cxx16
-rw-r--r--Source/cmTarget.h9
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<BT<std::string>> Utilities;
std::set<std::string> 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;