summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2012-11-05 13:48:42 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-01-08 19:38:16 (GMT)
commitbf5ece51c3827dc05018128fefe8270da88cfefb (patch)
tree1e12a12d0348c68446748e72fa5c49274b53cf9c /Source/cmTarget.cxx
parenta9f1bf438054227e989ad1706b785b978e18455c (diff)
downloadCMake-bf5ece51c3827dc05018128fefe8270da88cfefb.zip
CMake-bf5ece51c3827dc05018128fefe8270da88cfefb.tar.gz
CMake-bf5ece51c3827dc05018128fefe8270da88cfefb.tar.bz2
Keep track of properties used to determine linker libraries.
Those properties can't later be implicitly defined by the interface of those link libraries.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx42
1 files changed, 41 insertions, 1 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 25054c5..e4adb09 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2164,16 +2164,19 @@ void cmTarget::GetDirectLinkLibraries(const char *config,
{
cmListFileBacktrace lfbt;
cmGeneratorExpression ge(lfbt);
+ const cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop);
cmGeneratorExpressionDAGChecker dagChecker(lfbt,
this->GetName(),
"LINK_LIBRARIES", 0, 0);
- cmSystemTools::ExpandListArgument(ge.Parse(prop)->Evaluate(this->Makefile,
+ cmSystemTools::ExpandListArgument(cge->Evaluate(this->Makefile,
config,
false,
head,
&dagChecker),
libs);
+
+ this->AddLinkDependentTargetsForProperties(cge->GetSeenTargetProperties());
}
}
@@ -4377,6 +4380,43 @@ 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)
+ != this->LinkImplicitNullProperties.end();
+}
+
+//----------------------------------------------------------------------------
+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);
+ }
+ }
+}
+
+//----------------------------------------------------------------------------
void cmTarget::GetLanguages(std::set<cmStdString>& languages) const
{
for(std::vector<cmSourceFile*>::const_iterator