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 {...@@ -40,6 +40,10 @@ pub fn execute(args: [][]u8) !void {
40 \\ exe.addCSourceFile(fpath[1], @field(c_source_flags, fpath[0]));40 \\ exe.addCSourceFile(fpath[1], @field(c_source_flags, fpath[0]));
41 \\ }41 \\ }
42 \\}42 \\}
43 \\
44 \\fn get_flags(comptime index: usize) []const u8 {
45 \\ return std.meta.declarations(c_source_flags)[index].name;
46 \\}
43 });47 });
44 try w.print("\n", .{});48 try w.print("\n", .{});
45 try w.print("pub const packages = ", .{});49 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...@@ -211,9 +215,9 @@ fn print_csrc_dirs_to(w: std.fs.File.Writer, mod: u.Module, list: *std.ArrayList
211 try list.append(mod.clean_path);215 try list.append(mod.clean_path);
212 for (mod.c_source_files) |it| {216 for (mod.c_source_files) |it| {
213 if (!local) {217 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, "}"});
215 } else {219 } 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, "}"});
217 }221 }
218 }222 }
219 for (mod.deps) |d| {223 for (mod.deps) |d| {