| ... | ... | @@ -40,6 +40,10 @@ pub fn execute(args: [][]u8) !void { |
| 40 | 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 | 48 | try w.print("\n", .{}); |
| 45 | 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 | 215 | try list.append(mod.clean_path); |
| 212 | 216 | for (mod.c_source_files) |it| { |
| 213 | 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 | 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 | 223 | for (mod.deps) |d| { |