| ... | @@ -26,7 +26,7 @@ pub fn execute(args: [][]u8) !void { | ... | @@ -26,7 +26,7 @@ pub fn execute(args: [][]u8) !void { |
| 26 | try w.writeAll("const std = @import(\"std\");\n"); | 26 | try w.writeAll("const std = @import(\"std\");\n"); |
| 27 | try w.writeAll("const build = std.build;\n"); | 27 | try w.writeAll("const build = std.build;\n"); |
| 28 | try w.writeAll("\n"); | 28 | try w.writeAll("\n"); |
| 29 | try w.print("pub const cache = \"{s}\";\n", .{std.zig.fmtEscapes(dir)}); | 29 | try w.print("pub const cache = \"{}\";\n", .{std.zig.fmtEscapes(dir)}); |
| 30 | try w.writeAll("\n"); | 30 | try w.writeAll("\n"); |
| 31 | try w.print("{s}\n", .{ | 31 | try w.print("{s}\n", .{ |
| 32 | \\pub fn addAllTo(exe: *build.LibExeObjStep) void { | 32 | \\pub fn addAllTo(exe: *build.LibExeObjStep) void { |
| ... | @@ -118,7 +118,7 @@ fn print_paths(w: fs.File.Writer, list: []u.Module) !void { | ... | @@ -118,7 +118,7 @@ fn print_paths(w: fs.File.Writer, list: []u.Module) !void { |
| 118 | try w.print(" \"\",\n", .{}); | 118 | try w.print(" \"\",\n", .{}); |
| 119 | } else { | 119 | } else { |
| 120 | const s = std.fs.path.sep_str; | 120 | const s = std.fs.path.sep_str; |
| 121 | try w.print(" \"{s}{s}{s}\",\n", .{std.zig.fmtEscapes(s), std.zig.fmtEscapes(mod.clean_path), std.zig.fmtEscapes(s)}); | 121 | try w.print(" \"{}{}{}\",\n", .{std.zig.fmtEscapes(s), std.zig.fmtEscapes(mod.clean_path), std.zig.fmtEscapes(s)}); |
| 122 | } | 122 | } |
| 123 | } | 123 | } |
| 124 | } | 124 | } |
| ... | @@ -156,9 +156,9 @@ fn print_incl_dirs_to(w: fs.File.Writer, list: []u.Module) !void { | ... | @@ -156,9 +156,9 @@ fn print_incl_dirs_to(w: fs.File.Writer, list: []u.Module) !void { |
| 156 | } | 156 | } |
| 157 | for (mod.c_include_dirs) |it| { | 157 | for (mod.c_include_dirs) |it| { |
| 158 | if (i > 0) { | 158 | if (i > 0) { |
| 159 | try w.print(" cache ++ _paths[{}] ++ \"{s}\",\n", .{i, std.zig.fmtEscapes(it)}); | 159 | try w.print(" cache ++ _paths[{}] ++ \"{}\",\n", .{i, std.zig.fmtEscapes(it)}); |
| 160 | } else { | 160 | } else { |
| 161 | try w.print(" \"{s}\",\n", .{std.zig.fmtEscapes(it)}); | 161 | try w.print(" \"{}\",\n", .{std.zig.fmtEscapes(it)}); |
| 162 | } | 162 | } |
| 163 | } | 163 | } |
| 164 | } | 164 | } |
| ... | @@ -173,7 +173,7 @@ fn print_csrc_dirs_to(w: fs.File.Writer, list: []u.Module) !void { | ... | @@ -173,7 +173,7 @@ fn print_csrc_dirs_to(w: fs.File.Writer, list: []u.Module) !void { |
| 173 | if (i > 0) { | 173 | if (i > 0) { |
| 174 | try w.print(" {s}_ids[{}], cache ++ _paths[{}] ++ \"{s}\"{s},\n", .{"[_][]const u8{", i, i, it, "}"}); | 174 | try w.print(" {s}_ids[{}], cache ++ _paths[{}] ++ \"{s}\"{s},\n", .{"[_][]const u8{", i, i, it, "}"}); |
| 175 | } else { | 175 | } else { |
| 176 | try w.print(" {s}_ids[{}], \".{s}/{s}\"{s},\n", .{"[_][]const u8{", i, std.zig.fmtEscapes(mod.clean_path), it, "}"}); | 176 | try w.print(" {s}_ids[{}], \".{}/{s}\"{s},\n", .{"[_][]const u8{", i, std.zig.fmtEscapes(mod.clean_path), it, "}"}); |
| 177 | } | 177 | } |
| 178 | } | 178 | } |
| 179 | } | 179 | } |
| ... | @@ -189,7 +189,7 @@ fn print_csrc_flags_to(w: fs.File.Writer, list: []u.Module) !void { | ... | @@ -189,7 +189,7 @@ fn print_csrc_flags_to(w: fs.File.Writer, list: []u.Module) !void { |
| 189 | } | 189 | } |
| 190 | try w.print(" pub const @\"{s}\" = {s}", .{mod.id, "&.{"}); | 190 | try w.print(" pub const @\"{s}\" = {s}", .{mod.id, "&.{"}); |
| 191 | for (mod.c_source_flags) |it| { | 191 | for (mod.c_source_flags) |it| { |
| 192 | try w.print("\"{s}\",", .{std.zig.fmtEscapes(it)}); | 192 | try w.print("\"{}\",", .{std.zig.fmtEscapes(it)}); |
| 193 | } | 193 | } |
| 194 | try w.print("{s};\n", .{"}"}); | 194 | try w.print("{s};\n", .{"}"}); |
| 195 | | 195 | |
| ... | @@ -210,7 +210,7 @@ fn print_pkg_data_to(w: fs.File.Writer, list: *std.ArrayList(u.Module), list2: * | ... | @@ -210,7 +210,7 @@ fn print_pkg_data_to(w: fs.File.Writer, list: *std.ArrayList(u.Module), list2: * |
| 210 | while (i < list.items.len) : (i += 1) { | 210 | while (i < list.items.len) : (i += 1) { |
| 211 | const mod = list.items[i]; | 211 | const mod = list.items[i]; |
| 212 | if (contains_all(mod.deps, list2)) { | 212 | if (contains_all(mod.deps, list2)) { |
| 213 | try w.print(" pub const _{s} = build.Pkg{{ .name = \"{s}\", .path = cache ++ \"/{s}/{s}\", .dependencies = &[_]build.Pkg{{", .{mod.id, mod.name, std.zig.fmtEscapes(mod.clean_path), mod.main}); | 213 | try w.print(" pub const _{s} = build.Pkg{{ .name = \"{s}\", .path = cache ++ \"/{}/{s}\", .dependencies = &[_]build.Pkg{{", .{mod.id, mod.name, std.zig.fmtEscapes(mod.clean_path), mod.main}); |
| 214 | for (mod.deps) |d| { | 214 | for (mod.deps) |d| { |
| 215 | if (d.main.len > 0) { | 215 | if (d.main.len > 0) { |
| 216 | try w.print(" _{s},", .{d.id}); | 216 | try w.print(" _{s},", .{d.id}); |