aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-10-21 12:58:47 -0400
committerAndrew Kelley <superjoe30@gmail.com>2017-10-21 12:58:47 -0400
commitb3d12d2c9e64f0cd7db02e255686ee03dbec8de9 (patch)
tree736aa2fe6e05908632838eb6d9a34f556db977af
parent3c3af4b33296cdaaec25f9b6d403d6d1cf784b60 (diff)
downloadzig-b3d12d2c9e64f0cd7db02e255686ee03dbec8de9.tar.gz
zig-b3d12d2c9e64f0cd7db02e255686ee03dbec8de9.zip
zig build: fix system libraries not respected for C artifacts
closes #550
-rw-r--r--std/build.zig14
1 files changed, 14 insertions, 0 deletions
diff --git a/std/build.zig b/std/build.zig
index edbe5c8eae..84eba6d33b 100644
--- a/std/build.zig
+++ b/std/build.zig
@@ -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| {
@@ -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");