| ... | ... | @@ -537,21 +537,20 @@ pub fn build(b: *std.Build) !void { |
| 537 | 537 | |
| 538 | 538 | const update_mingw_step = b.step("update-mingw", "Update zig's bundled mingw"); |
| 539 | 539 | const opt_mingw_src_path = b.option([]const u8, "mingw-src", "path to mingw-w64 source directory"); |
| 540 | | const update_mingw_exe = b.addExecutable(.{ |
| 541 | | .name = "update_mingw", |
| 542 | | .target = b.graph.host, |
| 543 | | .root_source_file = b.path("tools/update_mingw.zig"), |
| 544 | | }); |
| 545 | | const update_mingw_run = b.addRunArtifact(update_mingw_exe); |
| 546 | | update_mingw_run.addDirectoryArg(b.path("lib")); |
| 547 | 540 | if (opt_mingw_src_path) |mingw_src_path| { |
| 541 | const update_mingw_exe = b.addExecutable(.{ |
| 542 | .name = "update_mingw", |
| 543 | .target = b.graph.host, |
| 544 | .root_source_file = b.path("tools/update_mingw.zig"), |
| 545 | }); |
| 546 | const update_mingw_run = b.addRunArtifact(update_mingw_exe); |
| 547 | update_mingw_run.addDirectoryArg(b.path("lib")); |
| 548 | 548 | update_mingw_run.addDirectoryArg(.{ .cwd_relative = mingw_src_path }); |
| 549 | |
| 550 | update_mingw_step.dependOn(&update_mingw_run.step); |
| 549 | 551 | } else { |
| 550 | | // Intentionally cause an error if this build step is requested. |
| 551 | | update_mingw_run.addArg("--missing-mingw-source-directory"); |
| 552 | update_mingw_step.dependOn(&b.addFail("The -Dmingw-src=... option is required for this step").step); |
| 552 | 553 | } |
| 553 | | |
| 554 | | update_mingw_step.dependOn(&update_mingw_run.step); |
| 555 | 554 | } |
| 556 | 555 | |
| 557 | 556 | fn addWasiUpdateStep(b: *std.Build, version: [:0]const u8) !void { |