diff options
author | Brad King <brad.king@kitware.com> | 2009-07-06 20:25:20 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-07-06 20:25:20 (GMT) |
commit | 06b0a692f45288eb4c8f3da9cde719583d2584be (patch) | |
tree | 2e08ee425f1aa3f14fabc91677359faefe83d5b4 /Source/cmExportFileGenerator.cxx | |
parent | 26df00f83a73821e39e20624d3ca7f66fdd4db97 (diff) | |
download | CMake-06b0a692f45288eb4c8f3da9cde719583d2584be.zip CMake-06b0a692f45288eb4c8f3da9cde719583d2584be.tar.gz CMake-06b0a692f45288eb4c8f3da9cde719583d2584be.tar.bz2 |
ENH: Centralize default link interface computation
When LINK_INTERFACE_LIBRARIES is not set we use the link implementation
to implicitly define the link interface. These changes centralize the
decision so that all linkable targets internally have a link interface.
Diffstat (limited to 'Source/cmExportFileGenerator.cxx')
-rw-r--r-- | Source/cmExportFileGenerator.cxx | 45 |
1 files changed, 1 insertions, 44 deletions
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index dc2efc5..f231e33 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -150,10 +150,8 @@ cmExportFileGenerator } // Add the transitive link dependencies for this configuration. - if(cmTargetLinkInterface const* iface = - target->GetLinkInterface(config)) + if(cmTargetLinkInterface const* iface = target->GetLinkInterface(config)) { - // This target provides a link interface, so use it. this->SetImportLinkProperty(suffix, target, "IMPORTED_LINK_INTERFACE_LIBRARIES", iface->Libraries, properties); @@ -161,47 +159,6 @@ cmExportFileGenerator "IMPORTED_LINK_DEPENDENT_LIBRARIES", iface->SharedDeps, properties); } - else if(target->GetType() == cmTarget::STATIC_LIBRARY || - target->GetType() == cmTarget::SHARED_LIBRARY) - { - // The default link interface for static and shared libraries is - // their link implementation library list. - this->SetImportLinkProperties(config, suffix, target, properties); - } -} - -//---------------------------------------------------------------------------- -void -cmExportFileGenerator -::SetImportLinkProperties(const char* config, std::string const& suffix, - cmTarget* target, ImportPropertyMap& properties) -{ - // Compute which library configuration to link. - cmTarget::LinkLibraryType linkType = target->ComputeLinkType(config); - - // Construct the list of libs linked for this configuration. - std::vector<std::string> actual_libs; - cmTarget::LinkLibraryVectorType const& libs = - target->GetOriginalLinkLibraries(); - for(cmTarget::LinkLibraryVectorType::const_iterator li = libs.begin(); - li != libs.end(); ++li) - { - // Skip entries that will resolve to the target itself, are empty, - // or are not meant for this configuration. - if(li->first == target->GetName() || li->first.empty() || - !(li->second == cmTarget::GENERAL || li->second == linkType)) - { - continue; - } - - // Store this entry. - actual_libs.push_back(li->first); - } - - // Store the entries in the property. - this->SetImportLinkProperty(suffix, target, - "IMPORTED_LINK_INTERFACE_LIBRARIES", - actual_libs, properties); } //---------------------------------------------------------------------------- |