summaryrefslogtreecommitdiffstats
path: root/Source/cmComputeLinkDepends.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-07-08 16:04:48 (GMT)
committerBrad King <brad.king@kitware.com>2009-07-08 16:04:48 (GMT)
commit7c67524dfac73bc5b8dea586bab0ce3e8206aeb7 (patch)
tree027b2394391b59f091a1426ece1541dcfeb3c2ee /Source/cmComputeLinkDepends.cxx
parentd1aa17a7b0f3b81367d4eb10e2404a5214f6890a (diff)
downloadCMake-7c67524dfac73bc5b8dea586bab0ce3e8206aeb7.zip
CMake-7c67524dfac73bc5b8dea586bab0ce3e8206aeb7.tar.gz
CMake-7c67524dfac73bc5b8dea586bab0ce3e8206aeb7.tar.bz2
ENH: Introduce cmTarget::LinkImplementation API
The new method centralizes loops that process raw OriginalLinkLibraries to extract the link implementation (libraries linked into the target) for each configuration. Results are computed on demand and then cached. This simplifies link interface computation because the default case trivially copies the link implementation.
Diffstat (limited to 'Source/cmComputeLinkDepends.cxx')
-rw-r--r--Source/cmComputeLinkDepends.cxx21
1 files changed, 7 insertions, 14 deletions
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx
index ef6926a..50a63eb 100644
--- a/Source/cmComputeLinkDepends.cxx
+++ b/Source/cmComputeLinkDepends.cxx
@@ -520,22 +520,15 @@ void cmComputeLinkDepends::AddVarLinkEntries(int depender_index,
void cmComputeLinkDepends::AddDirectLinkEntries()
{
// Add direct link dependencies in this configuration.
- int depender_index = -1;
- LinkLibraryVectorType const& libs=this->Target->GetOriginalLinkLibraries();
- std::vector<std::string> actual_libs;
- for(cmTarget::LinkLibraryVectorType::const_iterator li = libs.begin();
- li != libs.end(); ++li)
+ cmTarget::LinkImplementation const* impl =
+ this->Target->GetLinkImplementation(this->Config);
+ this->AddLinkEntries(-1, impl->Libraries);
+ for(std::vector<std::string>::const_iterator
+ wi = impl->WrongConfigLibraries.begin();
+ wi != impl->WrongConfigLibraries.end(); ++wi)
{
- if(li->second == cmTarget::GENERAL || li->second == this->LinkType)
- {
- actual_libs.push_back(li->first);
- }
- else if(this->OldLinkDirMode)
- {
- this->CheckWrongConfigItem(depender_index, li->first);
- }
+ this->CheckWrongConfigItem(-1, *wi);
}
- this->AddLinkEntries(depender_index, actual_libs);
}
//----------------------------------------------------------------------------