authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-12-02 01:17:04 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-12-02 01:17:04 -08:00
log38b28a222b3b0f897c4918fd85547045c2e2bab7
tree476eb04efa4bc27629a8c05cdea74dbb1e99d82e
parentabeab3b74c5cefc398f80dc0d2ec7c7e9cd64d21

only call `exe.linkLibC();` once


1 files changed, 2 insertions(+), 4 deletions(-)

src/cmd/fetch.zig+2-4
...@@ -57,9 +57,9 @@ pub fn create_depszig(cachepath: string, dir: std.fs.Dir, top_module: zigmod.Mod...@@ -57,9 +57,9 @@ pub fn create_depszig(cachepath: string, dir: std.fs.Dir, top_module: zigmod.Mod
57 \\ for (packages) |pkg| {57 \\ for (packages) |pkg| {
58 \\ exe.addPackage(pkg.pkg.?);58 \\ exe.addPackage(pkg.pkg.?);
59 \\ }59 \\ }
60 \\ var llc = false;
60 \\ inline for (std.meta.declarations(package_data)) |decl| {61 \\ inline for (std.meta.declarations(package_data)) |decl| {
61 \\ const pkg = @as(Package, @field(package_data, decl.name));62 \\ const pkg = @as(Package, @field(package_data, decl.name));
62 \\ var llc = false;
63 \\ inline for (pkg.system_libs) |item| {63 \\ inline for (pkg.system_libs) |item| {
64 \\ exe.linkSystemLibrary(item);64 \\ exe.linkSystemLibrary(item);
65 \\ llc = true;65 \\ llc = true;
...@@ -72,10 +72,8 @@ pub fn create_depszig(cachepath: string, dir: std.fs.Dir, top_module: zigmod.Mod...@@ -72,10 +72,8 @@ pub fn create_depszig(cachepath: string, dir: std.fs.Dir, top_module: zigmod.Mod
72 \\ exe.addCSourceFile(@field(dirs, decl.name) ++ "/" ++ item, pkg.c_source_flags);72 \\ exe.addCSourceFile(@field(dirs, decl.name) ++ "/" ++ item, pkg.c_source_flags);
73 \\ llc = true;73 \\ llc = true;
74 \\ }74 \\ }
75 \\ if (llc) {
76 \\ exe.linkLibC();
77 \\ }
78 \\ }75 \\ }
76 \\ if (llc) exe.linkLibC();
79 \\}77 \\}
80 \\78 \\
81 \\pub const Package = struct {79 \\pub const Package = struct {