Skip to content

Commit

Permalink
search: implement link_requires
Browse files Browse the repository at this point in the history
We have to track whether a component is a link only component, and the
only add the link flags.

TODO:
  - need a test for a case where we add a component as link-only, then
    need it as a full requires
  • Loading branch information
dcbaker committed Feb 11, 2025
1 parent aba53cd commit 33ddd1b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/cps/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -420,14 +420,16 @@ namespace cps::search {
self_defaults = true;
const std::vector<std::string> & defs = node->data.package.default_components.value();
std::transform(defs.begin(), defs.end(), std::back_insert_iterator(node->data.components),
[](std::string name) { return Component{std::move(name)}; });
[link_only](std::string name) {
return Component{std::move(name), link_only};
});
}
for (auto && comp : self->second.components) {
if (processed.find(comp) != processed.end()) {
continue;
}
self_requires.emplace_back(Component{comp});
node->data.components.emplace_back(Component{comp});
self_requires.emplace_back(Component{comp, link_only});
node->data.components.emplace_back(Component{comp, link_only});
}
}
}
Expand Down

0 comments on commit 33ddd1b

Please sign in to comment.