| ... | ... | @@ -796,16 +796,19 @@ pub fn addSystemCommand(b: *Build, argv: []const []const u8) *Step.Run { |
| 796 | 796 | |
| 797 | 797 | /// Creates a `Step.Run` with an executable built with `addExecutable`. |
| 798 | 798 | /// Add command line arguments with methods of `Step.Run`. |
| 799 | /// |
| 800 | /// It doesn't have to target the host. In some cases cross-compiled binaries |
| 801 | /// can even be executed. |
| 802 | /// |
| 803 | /// This is declarative; it constructs a build step that may or may not be run |
| 804 | /// depending on the options provided by the user to the build command. |
| 799 | 805 | pub fn addRunArtifact(b: *Build, exe: *Step.Compile) *Step.Run { |
| 800 | | // It doesn't have to be native. We catch that if you actually try to run it. |
| 801 | | // Consider that this is declarative; the run step may not be run unless a user |
| 802 | | // option is supplied. |
| 803 | 806 | |
| 804 | 807 | // Avoid the common case of the step name looking like "run test test". |
| 805 | 808 | const step_name = if (exe.kind.isTest() and mem.eql(u8, exe.name, "test")) |
| 806 | | b.fmt("run {s}", .{@tagName(exe.kind)}) |
| 809 | b.fmt("run {t}", .{exe.kind}) |
| 807 | 810 | else |
| 808 | | b.fmt("run {s} {s}", .{ @tagName(exe.kind), exe.name }); |
| 811 | b.fmt("run {t} {s}", .{ exe.kind, exe.name }); |
| 809 | 812 | |
| 810 | 813 | const run_step = Step.Run.create(b, step_name); |
| 811 | 814 | run_step.producer = exe; |