Skip to content

Commit 31b2568

Browse files
committed
loader: Add link_requires
This just loads the link_requires, but doesn't do anything with it.
1 parent dceec9a commit 31b2568

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/cps/loader.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,8 @@ namespace cps::loader {
275275
.value_or(std::vector<std::string>{});
276276
auto const location = CPS_TRY(get_optional<std::string>(comp, name, "location"));
277277
auto const link_location = CPS_TRY(get_optional<std::string>(comp, name, "link_location"));
278+
auto const link_requires = CPS_TRY(get_optional<std::vector<std::string>>(comp, name, "link_requires"))
279+
.value_or(std::vector<std::string>{});
278280
auto const require = CPS_TRY(get_optional<std::vector<std::string>>(comp, name, "requires"))
279281
.value_or(std::vector<std::string>{});
280282

@@ -294,6 +296,7 @@ namespace cps::loader {
294296
.definitions = std::move(definitions),
295297
.link_flags = std::move(link_flags),
296298
.link_libraries = std::move(link_libraries),
299+
.link_requires = std::move(link_requires),
297300
.location = std::move(location),
298301
.link_location = std::move(link_location),
299302
.require = std::move(require),

src/cps/loader.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ namespace cps::loader {
7373
std::vector<std::string> link_flags;
7474
// TODO: std::vector<LinkLanguage> link_languages;
7575
std::vector<std::string> link_libraries;
76-
// TODO: link_requires
76+
std::vector<std::string> link_requires;
7777
std::optional<std::string> location;
7878
std::optional<std::string> link_location;
7979
std::vector<std::string> require; // requires is a keyword

src/cps/pc_compat/pc_loader.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ namespace cps::pc_compat {
119119
.definitions = loader::Defines{},
120120
.link_flags = link_flags,
121121
.link_libraries = {},
122+
.link_requires = {},
122123
// TODO: Currently lib location is hard coded to appease assertions. This would
123124
// need to implement linker-like search to replicate current behavior.
124125
.location = fmt::format("@prefix@/lib/{}.a", name),

0 commit comments

Comments
 (0)