summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-02-07 12:04:46 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-02-07 15:21:09 (GMT)
commitd4e5c6787c40e27394c336730f59d878a81d1991 (patch)
treec262428c71c0c4fd31f24f71f2347031358db0d6 /Source/cmTarget.cxx
parent1fb545ad3a8f6d263c9f01300bce978e81b6fe8c (diff)
downloadCMake-d4e5c6787c40e27394c336730f59d878a81d1991.zip
CMake-d4e5c6787c40e27394c336730f59d878a81d1991.tar.gz
CMake-d4e5c6787c40e27394c336730f59d878a81d1991.tar.bz2
Don't keep track of content determined by target property values.
This tracking was added during the development of commit 042ecf04 (Add API to calculate link-interface-dependent bool properties or error., 2013-01-06), but was never used. It was not necessary to use the content because what is really useful in that logic is to determine if a property has been implied to be null by appearing in a LINK_LIBRARIES genex. I think the motivating usecase for developing the feature of keeping track of the targets relevant to a property was that I thought it would make it possible to allow requiring granular compatibility of interface properties only for targets which depended on the interface property. Eg: add_library(foo ...) add_library(bar ...) add_executable(user ...) # Read the INTERFACE_POSITION_INDEPENDENT_CODE from bar, but not # from foo: target_link_libraries(user foo $<$<TARGET_PROPERTY:POSTITION_INDEPENDENT_CODE>:bar>) This obviously doesn't make sense. We require that INTERFACE properties are consistent across all linked targets instead.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx43
1 files changed, 9 insertions, 34 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 6f197b8..f55999f 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2233,7 +2233,15 @@ void cmTarget::GetDirectLinkLibraries(const char *config,
&dagChecker),
libs);
- this->AddLinkDependentTargetsForProperties(cge->GetSeenTargetProperties());
+ std::set<cmStdString> seenProps = cge->GetSeenTargetProperties();
+ for (std::set<cmStdString>::const_iterator it = seenProps.begin();
+ it != seenProps.end(); ++it)
+ {
+ if (!this->GetProperty(it->c_str()))
+ {
+ this->LinkImplicitNullProperties.insert(*it);
+ }
+ }
}
}
@@ -4520,18 +4528,6 @@ const char* cmTarget::GetExportMacro()
}
//----------------------------------------------------------------------------
-void cmTarget::GetLinkDependentTargetsForProperty(const std::string &p,
- std::set<std::string> &targets)
-{
- const std::map<cmStdString, std::set<std::string> >::const_iterator findIt
- = this->LinkDependentProperties.find(p);
- if (findIt != this->LinkDependentProperties.end())
- {
- targets = findIt->second;
- }
-}
-
-//----------------------------------------------------------------------------
bool cmTarget::IsNullImpliedByLinkLibraries(const std::string &p)
{
return this->LinkImplicitNullProperties.find(p)
@@ -4539,24 +4535,6 @@ bool cmTarget::IsNullImpliedByLinkLibraries(const std::string &p)
}
//----------------------------------------------------------------------------
-void cmTarget::AddLinkDependentTargetsForProperties(
- const std::map<cmStdString, cmStdString> &map)
-{
- for (std::map<cmStdString, cmStdString>::const_iterator it = map.begin();
- it != map.end(); ++it)
- {
- std::vector<std::string> targets;
- cmSystemTools::ExpandListArgument(it->second.c_str(), targets);
- this->LinkDependentProperties[it->first].insert(targets.begin(),
- targets.end());
- if (!this->GetProperty(it->first.c_str()))
- {
- this->LinkImplicitNullProperties.insert(it->first);
- }
- }
-}
-
-//----------------------------------------------------------------------------
template<typename PropertyType>
PropertyType getTypedProperty(cmTarget *tgt, const char *prop,
PropertyType *);
@@ -4611,9 +4589,6 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget *tgt,
const bool explicitlySet = tgt->GetProperties()
.find(p.c_str())
!= tgt->GetProperties().end();
- std::set<std::string> dependentTargets;
- tgt->GetLinkDependentTargetsForProperty(p,
- dependentTargets);
const bool impliedByUse =
tgt->IsNullImpliedByLinkLibraries(p);
assert((impliedByUse ^ explicitlySet)