Skip to content

Commit b3d12d2

Browse files
committed
zig build: fix system libraries not respected for C artifacts
closes #550
1 parent 3c3af4b commit b3d12d2

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

std/build.zig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,6 +1400,13 @@ pub const LibExeObjStep = struct {
14001400
%%cc_args.append(builder.pathFromRoot(full_path_lib));
14011401
}
14021402

1403+
{
1404+
var it = self.link_libs.iterator();
1405+
while (it.next()) |entry| {
1406+
%%cc_args.append(builder.fmt("-l{}", entry.key));
1407+
}
1408+
}
1409+
14031410
if (is_darwin and !self.static) {
14041411
var it = self.frameworks.iterator();
14051412
while (it.next()) |entry| {
@@ -1464,6 +1471,13 @@ pub const LibExeObjStep = struct {
14641471

14651472
%%cc_args.append("-rdynamic");
14661473

1474+
{
1475+
var it = self.link_libs.iterator();
1476+
while (it.next()) |entry| {
1477+
%%cc_args.append(builder.fmt("-l{}", entry.key));
1478+
}
1479+
}
1480+
14671481
if (is_darwin) {
14681482
if (self.need_flat_namespace_hack) {
14691483
%%cc_args.append("-Wl,-flat_namespace");

0 commit comments

Comments
 (0)