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:54:17 -07:00
log5a04adea0d459efc2ea2f15e4ceac0d5277d86fd
treeb4f7787564f0529f5d420ca270137bf09c0ba40f
parent778d8d5596d64c171f669ae198e13529ac511330

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
6767 \\ exe.linkSystemLibrary(libname);
6868 \\ exe.linkLibC();
6969 \\ }
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;
7072 \\}
7173 \\
7274 \\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
133133 \\ const module = pkg.module(exe, fetch_step);
134134 \\ exe.root_module.addImport(pkg.name, module);
135135 \\ }
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;
136138 \\}
137139 \\
138140 \\var link_lib_c = false;