authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-04-13 17:47:38 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-04-13 17:47:38 -07:00
logae17b466f8c7971edd28125a68a4f9ffdc291dd9
tree266235941a6e593ff40deb8e93bae91324b18ac3
parent1e19786b1bb2e39ea65dce34dcfd3465deeef881

deps.zig: fix bug from having multiple exes that depend on c code


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

src/cmd/fetch.zig+2
...@@ -67,6 +67,8 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D...@@ -67,6 +67,8 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D
67 \\ exe.linkSystemLibrary(libname);67 \\ exe.linkSystemLibrary(libname);
68 \\ exe.linkLibC();68 \\ exe.linkLibC();
69 \\ }69 \\ }
70 \\ // clear module memo cache so addAllTo can be called more than once in the same build.zig
71 \\ inline for (comptime std.meta.declarations(package_data)) |decl| @field(package_data, decl.name).module_memo = null;
70 \\}72 \\}
71 \\73 \\
72 \\var link_lib_c = false;74 \\var link_lib_c = false;
src/cmd/generate.zig+2
...@@ -133,6 +133,8 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D...@@ -133,6 +133,8 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D
133 \\ const module = pkg.module(exe, fetch_step);133 \\ const module = pkg.module(exe, fetch_step);
134 \\ exe.root_module.addImport(pkg.name, module);134 \\ exe.root_module.addImport(pkg.name, module);
135 \\ }135 \\ }
136 \\ // clear module memo cache so addAllTo can be called more than once in the same build.zig
137 \\ inline for (comptime std.meta.declarations(package_data)) |decl| @field(package_data, decl.name).module_memo = null;
136 \\}138 \\}
137 \\139 \\
138 \\var link_lib_c = false;140 \\var link_lib_c = false;