summaryrefslogtreecommitdiffstats
path: root/Source/cmComputeTargetDepends.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-11-20 11:44:04 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-11-25 15:17:50 (GMT)
commit0bfcb450e6cab8d9c2c079e10bf0acea62ffadbe (patch)
treeeb8e1b76aae32f91fc6f5f47e81bd709b87215ed /Source/cmComputeTargetDepends.cxx
parent9f095b74162b972d07c695ad23964056f310ade2 (diff)
downloadCMake-0bfcb450e6cab8d9c2c079e10bf0acea62ffadbe.zip
CMake-0bfcb450e6cab8d9c2c079e10bf0acea62ffadbe.tar.gz
CMake-0bfcb450e6cab8d9c2c079e10bf0acea62ffadbe.tar.bz2
INTERFACE_LIBRARY: Avoid codepaths which set unneeded properties.
As an INTERFACE_LIBRARY has no direct link dependencies, we can short-circuit in cmGeneratorExpressionEvaluator and in cmGlobalGenerator::CheckLocalGenerators. As they do not generate any output directly, any generate- or install- related code acn also be short-circuited. Many of the local generators already do this. Because only INTERFACE related properties make sense on INTERFACE_LIBRARY targets, avoid setting other properties, for example via defaults.
Diffstat (limited to 'Source/cmComputeTargetDepends.cxx')
-rw-r--r--Source/cmComputeTargetDepends.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx
index 7fd4754..cb9e37e 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -237,7 +237,15 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
it != configs.end(); ++it)
{
std::vector<std::string> tlibs;
- depender->GetDirectLinkLibraries(it->c_str(), tlibs, depender);
+ if (depender->GetType() == cmTarget::INTERFACE_LIBRARY)
+ {
+ // For INTERFACE_LIBRARY depend on the interface instead.
+ depender->GetInterfaceLinkLibraries(it->c_str(), tlibs, depender);
+ }
+ else
+ {
+ depender->GetDirectLinkLibraries(it->c_str(), tlibs, depender);
+ }
// A target should not depend on itself.
emitted.insert(depender->GetName());
for(std::vector<std::string>::const_iterator lib = tlibs.begin();