| 734 | } |
| 735 | |
| 736 | cmLinkInterfaceLibraries 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 | |
| 773 | void cmGeneratorTarget::ComputeLinkInterfaceLibraries( |
| 774 | std::string const& config, cmOptionalLinkInterface& iface, |
no test coverage detected