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

Method Compute

Source/cmGeneratorTarget_Link.cxx:1068–1096  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1066}
1067
1068void TransitiveLinkImpl::Compute()
1069{
1070 // Save the original items and start with an empty list.
1071 std::vector<cmLinkItem> original = std::move(this->Impl.Libraries);
1072
1073 // Avoid injecting any original items as usage requirements.
1074 // This gives LINK_LIBRARIES final control over the order
1075 // if it explicitly lists everything.
1076 this->Emitted.insert(original.cbegin(), original.cend());
1077
1078 // Process each original item.
1079 for (cmLinkItem& item : original) {
1080 // Inject direct dependencies listed in 'INTERFACE_LINK_LIBRARIES_DIRECT'
1081 // usage requirements before the item itself.
1082 this->Follow(item.Target);
1083
1084 // Add the item itself.
1085 this->Impl.Libraries.emplace_back(std::move(item));
1086 }
1087
1088 // Remove items listed in 'INTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE'
1089 // usage requirements found through any dependency above.
1090 this->Impl.Libraries.erase(
1091 std::remove_if(this->Impl.Libraries.begin(), this->Impl.Libraries.end(),
1092 [this](cmLinkItem const& item) {
1093 return this->Excluded.find(item) != this->Excluded.end();
1094 }),
1095 this->Impl.Libraries.end());
1096}
1097
1098void ComputeLinkImplTransitive(cmGeneratorTarget const* self,
1099 std::string const& config, UseTo usage,

Callers 2

GetLinkInformationMethod · 0.45

Calls 10

FollowMethod · 0.95
moveFunction · 0.85
cbeginMethod · 0.80
cendMethod · 0.80
emplace_backMethod · 0.80
eraseMethod · 0.80
insertMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected