cmTarget: Replace PolicyStatus members with PolicyMap.
sizeof(cmTarget) goes from 856 to 840 with GNU libstdc++ 5.1.
This commit is contained in:
parent
6f148e4a48
commit
647488570b
@ -239,13 +239,6 @@ cmTargetInternals::~cmTargetInternals()
|
|||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
cmTarget::cmTarget()
|
cmTarget::cmTarget()
|
||||||
{
|
{
|
||||||
#define INITIALIZE_TARGET_POLICY_MEMBER(POLICY) \
|
|
||||||
this->PolicyStatus ## POLICY = cmPolicies::WARN;
|
|
||||||
|
|
||||||
CM_FOR_EACH_TARGET_POLICY(INITIALIZE_TARGET_POLICY_MEMBER)
|
|
||||||
|
|
||||||
#undef INITIALIZE_TARGET_POLICY_MEMBER
|
|
||||||
|
|
||||||
this->Makefile = 0;
|
this->Makefile = 0;
|
||||||
#if defined(_WIN32) && !defined(__CYGWIN__)
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
this->LinkLibrariesForVS6Analyzed = false;
|
this->LinkLibrariesForVS6Analyzed = false;
|
||||||
@ -440,20 +433,14 @@ void cmTarget::SetMakefile(cmMakefile* mf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Record current policies for later use.
|
// Record current policies for later use.
|
||||||
#define CAPTURE_TARGET_POLICY(POLICY) \
|
this->Makefile->RecordPolicies(this->PolicyMap);
|
||||||
this->PolicyStatus ## POLICY = \
|
|
||||||
this->Makefile->GetPolicyStatus(cmPolicies::POLICY);
|
|
||||||
|
|
||||||
CM_FOR_EACH_TARGET_POLICY(CAPTURE_TARGET_POLICY)
|
|
||||||
|
|
||||||
#undef CAPTURE_TARGET_POLICY
|
|
||||||
|
|
||||||
if (this->TargetTypeValue == INTERFACE_LIBRARY)
|
if (this->TargetTypeValue == INTERFACE_LIBRARY)
|
||||||
{
|
{
|
||||||
// This policy is checked in a few conditions. The properties relevant
|
// This policy is checked in a few conditions. The properties relevant
|
||||||
// to the policy are always ignored for INTERFACE_LIBRARY targets,
|
// to the policy are always ignored for INTERFACE_LIBRARY targets,
|
||||||
// so ensure that the conditions don't lead to nonsense.
|
// so ensure that the conditions don't lead to nonsense.
|
||||||
this->PolicyStatusCMP0022 = cmPolicies::NEW;
|
this->PolicyMap.Set(cmPolicies::CMP0022, cmPolicies::NEW);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->GetType() != INTERFACE_LIBRARY && this->GetType() != UTILITY)
|
if (this->GetType() != INTERFACE_LIBRARY && this->GetType() != UTILITY)
|
||||||
|
@ -144,7 +144,7 @@ public:
|
|||||||
|
|
||||||
#define DECLARE_TARGET_POLICY(POLICY) \
|
#define DECLARE_TARGET_POLICY(POLICY) \
|
||||||
cmPolicies::PolicyStatus GetPolicyStatus ## POLICY () const \
|
cmPolicies::PolicyStatus GetPolicyStatus ## POLICY () const \
|
||||||
{ return this->PolicyStatus ## POLICY; }
|
{ return this->PolicyMap.Get(cmPolicies::POLICY); }
|
||||||
|
|
||||||
CM_FOR_EACH_TARGET_POLICY(DECLARE_TARGET_POLICY)
|
CM_FOR_EACH_TARGET_POLICY(DECLARE_TARGET_POLICY)
|
||||||
|
|
||||||
@ -828,14 +828,7 @@ private:
|
|||||||
// The cmMakefile instance that owns this target. This should
|
// The cmMakefile instance that owns this target. This should
|
||||||
// always be set.
|
// always be set.
|
||||||
cmMakefile* Makefile;
|
cmMakefile* Makefile;
|
||||||
|
cmPolicies::PolicyMap PolicyMap;
|
||||||
// Policy status recorded when target was created.
|
|
||||||
#define TARGET_POLICY_MEMBER(POLICY) \
|
|
||||||
cmPolicies::PolicyStatus PolicyStatus ## POLICY;
|
|
||||||
|
|
||||||
CM_FOR_EACH_TARGET_POLICY(TARGET_POLICY_MEMBER)
|
|
||||||
|
|
||||||
#undef TARGET_POLICY_MEMBER
|
|
||||||
|
|
||||||
// Internal representation details.
|
// Internal representation details.
|
||||||
friend class cmTargetInternals;
|
friend class cmTargetInternals;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user