Skip to content

Commit 33ddd1b

Browse files
committed
search: implement link_requires
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
1 parent aba53cd commit 33ddd1b

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/cps/search.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -420,14 +420,16 @@ namespace cps::search {
420420
self_defaults = true;
421421
const std::vector<std::string> & defs = node->data.package.default_components.value();
422422
std::transform(defs.begin(), defs.end(), std::back_insert_iterator(node->data.components),
423-
[](std::string name) { return Component{std::move(name)}; });
423+
[link_only](std::string name) {
424+
return Component{std::move(name), link_only};
425+
});
424426
}
425427
for (auto && comp : self->second.components) {
426428
if (processed.find(comp) != processed.end()) {
427429
continue;
428430
}
429-
self_requires.emplace_back(Component{comp});
430-
node->data.components.emplace_back(Component{comp});
431+
self_requires.emplace_back(Component{comp, link_only});
432+
node->data.components.emplace_back(Component{comp, link_only});
431433
}
432434
}
433435
}

0 commit comments

Comments
 (0)