| author | |
| committer | |
| log | 4563f6b4242957971d619aa23263938fdcb442d3 |
| tree | 02e921db4e1885b2b7ff21a0158a6bc09fc32abc |
| parent | 6365f5a9f3f60c1a65f91dcf2926fefee4228b21 |
| signature |
closes #19683 files changed, 14 insertions(+), 0 deletions(-)
CMakeLists.txt+1| ... | ... | @@ -448,6 +448,7 @@ set(ZIG_STD_FILES |
| 448 | 448 | "buf_set.zig" |
| 449 | 449 | "buffer.zig" |
| 450 | 450 | "build.zig" |
| 451 | "build/fmt.zig" | |
| 451 | 452 | "c/darwin.zig" |
| 452 | 453 | "c/freebsd.zig" |
| 453 | 454 | "c/index.zig" |
build.zig+7| ... | ... | @@ -55,6 +55,8 @@ pub fn build(b: *Builder) !void { |
| 55 | 55 | var test_stage2 = b.addTest("src-self-hosted/test.zig"); |
| 56 | 56 | test_stage2.setBuildMode(builtin.Mode.Debug); |
| 57 | 57 | |
| 58 | const fmt_build_zig = b.addFmt([][]const u8{"build.zig"}); | |
| 59 | ||
| 58 | 60 | var exe = b.addExecutable("zig", "src-self-hosted/main.zig"); |
| 59 | 61 | exe.setBuildMode(mode); |
| 60 | 62 | |
| ... | ... | @@ -106,6 +108,11 @@ pub fn build(b: *Builder) !void { |
| 106 | 108 | } |
| 107 | 109 | const modes = chosen_modes[0..chosen_mode_index]; |
| 108 | 110 | |
| 111 | // run stage1 `zig fmt` on this build.zig file just to make sure it works | |
| 112 | test_step.dependOn(&fmt_build_zig.step); | |
| 113 | const fmt_step = b.step("test-fmt", "Run zig fmt against build.zig to make sure it works"); | |
| 114 | fmt_step.dependOn(&fmt_build_zig.step); | |
| 115 | ||
| 109 | 116 | test_step.dependOn(tests.addPkgTests(b, test_filter, "test/stage1/behavior.zig", "behavior", "Run the behavior tests", modes)); |
| 110 | 117 | |
| 111 | 118 | test_step.dependOn(tests.addPkgTests(b, test_filter, "std/index.zig", "std", "Run the standard library tests", modes)); |
std/build.zig+6| ... | ... | @@ -15,6 +15,8 @@ const BufSet = std.BufSet; |
| 15 | 15 | const BufMap = std.BufMap; |
| 16 | 16 | const fmt_lib = std.fmt; |
| 17 | 17 | |
| 18 | pub const FmtStep = @import("build/fmt.zig").FmtStep; | |
| 19 | ||
| 18 | 20 | pub const Builder = struct { |
| 19 | 21 | uninstall_tls: TopLevelStep, |
| 20 | 22 | install_tls: TopLevelStep, |
| ... | ... | @@ -205,6 +207,10 @@ pub const Builder = struct { |
| 205 | 207 | return remove_dir_step; |
| 206 | 208 | } |
| 207 | 209 | |
| 210 | pub fn addFmt(self: *Builder, paths: []const []const u8) *FmtStep { | |
| 211 | return FmtStep.create(self, paths); | |
| 212 | } | |
| 213 | ||
| 208 | 214 | pub fn version(self: *const Builder, major: u32, minor: u32, patch: u32) Version { |
| 209 | 215 | return Version{ |
| 210 | 216 | .major = major, |