Skip to content

Commit bd9cc04

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

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
@@ -249,6 +249,8 @@ namespace cps::loader {
249249
.value_or(std::vector<std::string>{});
250250
auto const location = CPS_TRY(get_optional<std::string>(comp, name, "location"));
251251
auto const link_location = CPS_TRY(get_optional<std::string>(comp, name, "link_location"));
252+
auto const link_requires = CPS_TRY(get_optional<std::vector<std::string>>(comp, name, "link_requires"))
253+
.value_or(std::vector<std::string>{});
252254
auto const require = CPS_TRY(get_optional<std::vector<std::string>>(comp, name, "requires"))
253255
.value_or(std::vector<std::string>{});
254256

@@ -268,6 +270,7 @@ namespace cps::loader {
268270
.definitions = std::move(definitions),
269271
.link_flags = std::move(link_flags),
270272
.link_libraries = std::move(link_libraries),
273+
.link_requires = std::move(link_requires),
271274
.location = std::move(location),
272275
.link_location = std::move(link_location),
273276
.require = std::move(require),

src/cps/loader.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ namespace cps::loader {
7070
std::vector<std::string> link_flags;
7171
// TODO: std::vector<LinkLanguage> link_languages;
7272
std::vector<std::string> link_libraries;
73-
// TODO: link_requires
73+
std::vector<std::string> link_requires;
7474
std::optional<std::string> location;
7575
std::optional<std::string> link_location;
7676
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)