summaryrefslogtreecommitdiffstats
path: root/Source/cmComputeLinkInformation.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-04-21 17:51:51 (GMT)
committerBrad King <brad.king@kitware.com>2015-04-21 18:03:02 (GMT)
commitfaede40b46dee698d091e80b8c4658a70a1eb326 (patch)
tree1fd8c5bb481cec4dbdf5d971c421e42fd319fb95 /Source/cmComputeLinkInformation.cxx
parent5a5ef00106662da5c6400d76438289f505b4a1ff (diff)
downloadCMake-faede40b46dee698d091e80b8c4658a70a1eb326.zip
CMake-faede40b46dee698d091e80b8c4658a70a1eb326.tar.gz
CMake-faede40b46dee698d091e80b8c4658a70a1eb326.tar.bz2
cmComputeLinkInformation: Reduce 'if' nesting in AddItem
Also add a comment explaining why interface libraries still get a link item.
Diffstat (limited to 'Source/cmComputeLinkInformation.cxx')
-rw-r--r--Source/cmComputeLinkInformation.cxx12
1 files changed, 7 insertions, 5 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index 83d38ef..6ecf0dc 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -653,6 +653,13 @@ void cmComputeLinkInformation::AddItem(std::string const& item,
this->Items.push_back(Item(linkItem, true, tgt));
this->Depends.push_back(exe);
}
+ else if(tgt->GetType() == cmTarget::INTERFACE_LIBRARY)
+ {
+ // Add the interface library as an item so it can be considered as part
+ // of COMPATIBLE_INTERFACE_ enforcement. The generators will ignore
+ // this for the actual link line.
+ this->Items.push_back(Item(std::string(), true, tgt));
+ }
else
{
// Decide whether to use an import library.
@@ -660,11 +667,6 @@ void cmComputeLinkInformation::AddItem(std::string const& item,
(this->UseImportLibrary &&
(impexe || tgt->GetType() == cmTarget::SHARED_LIBRARY));
- if(tgt->GetType() == cmTarget::INTERFACE_LIBRARY)
- {
- this->Items.push_back(Item(std::string(), true, tgt));
- return;
- }
// Pass the full path to the target file.
std::string lib = tgt->GetFullPath(config, implib, true);
if(!this->LinkDependsNoShared ||