authorgravatar for hello@nektro.netMeghan <hello@nektro.net> 2020-11-28 12:43:03 -08:00
committergravatar for hello@nektro.netMeghan <hello@nektro.net> 2020-11-28 12:43:03 -08:00
log27c6c3754ca8e00b61371c3ea10e1efa38767183
treecf5346d73d344e5da02c7e1563cff91029a27e41
parentc7650267c0dbc69dcd61fd8a0d922e1dcba818dd

dry up deps.zig


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

src/cmd_fetch.zig+6-2
......@@ -40,6 +40,10 @@ pub fn execute(args: [][]u8) !void {
4040 \\ exe.addCSourceFile(fpath[1], @field(c_source_flags, fpath[0]));
4141 \\ }
4242 \\}
43 \\
44 \\fn get_flags(comptime index: usize) []const u8 {
45 \\ return std.meta.declarations(c_source_flags)[index].name;
46 \\}
4347 });
4448 try w.print("\n", .{});
4549 try w.print("pub const packages = ", .{});
......@@ -211,9 +215,9 @@ fn print_csrc_dirs_to(w: std.fs.File.Writer, mod: u.Module, list: *std.ArrayList
211215 try list.append(mod.clean_path);
212216 for (mod.c_source_files) |it| {
213217 if (!local) {
214 try w.print(" {}\"{}\", cache ++ \"/{}/{}\"{},\n", .{"[_][]const u8{", mod.clean_path, mod.clean_path, it, "}"});
218 try w.print(" {}comptime get_flags({}), cache ++ \"/{}/{}\"{},\n", .{"[_][]const u8{", list.items.len-1, mod.clean_path, it, "}"});
215219 } else {
216 try w.print(" {}\"{}\", \".{}/{}\"{},\n", .{"[_][]const u8{", mod.clean_path, mod.clean_path, it, "}"});
220 try w.print(" {}comptime get_flags({}), \".{}/{}\"{},\n", .{"[_][]const u8{", list.items.len-1, mod.clean_path, it, "}"});
217221 }
218222 }
219223 for (mod.deps) |d| {