MCPcopy Create free account
hub / github.com/Kitware/CMake / GetLinkInterfaceLibraries

Method GetLinkInterfaceLibraries

Source/cmGeneratorTarget_Link.cxx:736–771  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

734}
735
736cmLinkInterfaceLibraries const* cmGeneratorTarget::GetLinkInterfaceLibraries(
737 std::string const& config, cmGeneratorTarget const* head, UseTo usage) const
738{
739 // Imported targets have their own link interface.
740 if (this->IsImported()) {
741 return this->GetImportLinkInterface(config, head, usage);
742 }
743
744 // Link interfaces are not supported for executables that do not
745 // export symbols.
746 if (this->GetType() == cmStateEnums::EXECUTABLE &&
747 !this->IsExecutableWithExports()) {
748 return nullptr;
749 }
750
751 // Lookup any existing link interface for this configuration.
752 cmHeadToLinkInterfaceMap& hm =
753 (usage == UseTo::Compile
754 ? this->GetHeadToLinkInterfaceUsageRequirementsMap(config)
755 : this->GetHeadToLinkInterfaceMap(config));
756
757 // If the link interface does not depend on the head target
758 // then reuse the one from the head we computed first.
759 if (!hm.empty() && !hm.begin()->second.HadHeadSensitiveCondition) {
760 head = hm.begin()->first;
761 }
762
763 cmOptionalLinkInterface& iface = hm[head];
764 MaybeEnableCheckLinkLibraries(iface);
765 if (!iface.LibrariesDone) {
766 iface.LibrariesDone = true;
767 this->ComputeLinkInterfaceLibraries(config, iface, head, usage);
768 }
769
770 return iface.Exists ? &iface : nullptr;
771}
772
773void cmGeneratorTarget::ComputeLinkInterfaceLibraries(
774 std::string const& config, cmOptionalLinkInterface& iface,

Callers 10

CheckLinkLibrariesMethod · 0.95
GetDependenciesMethod · 0.80
processILibsFunction · 0.80
FollowMethod · 0.80

Calls 8

IsImportedMethod · 0.95
GetTypeMethod · 0.95
emptyMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected