Skip to content

Commit

Permalink
zig build: fix system libraries not respected for C artifacts
Browse files Browse the repository at this point in the history
closes #550
  • Loading branch information
andrewrk committed Oct 21, 2017
1 parent 3c3af4b commit b3d12d2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions std/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1400,6 +1400,13 @@ pub const LibExeObjStep = struct {
%%cc_args.append(builder.pathFromRoot(full_path_lib));
}

{
var it = self.link_libs.iterator();
while (it.next()) |entry| {
%%cc_args.append(builder.fmt("-l{}", entry.key));
}
}

if (is_darwin and !self.static) {
var it = self.frameworks.iterator();
while (it.next()) |entry| {
Expand Down Expand Up @@ -1464,6 +1471,13 @@ pub const LibExeObjStep = struct {

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

{
var it = self.link_libs.iterator();
while (it.next()) |entry| {
%%cc_args.append(builder.fmt("-l{}", entry.key));
}
}

if (is_darwin) {
if (self.need_flat_namespace_hack) {
%%cc_args.append("-Wl,-flat_namespace");
Expand Down

0 comments on commit b3d12d2

Please sign in to comment.