authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-03-19 17:08:50-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-03-19 17:08:50-04:00
logac34841270d34fb2f47ada2960d7281328ec7b25
tree036c1704ec98368c312dd243279b98d138b74dba
parent9801a1df6a6a55bb98cb4141d7e8f7340f324de2
signaturelock-open Commit is signed but in an unrecognized format.

build.zig: allow run() on non-native target artifacts


1 files changed, 3 insertions(+), 1 deletions(-)

std/build.zig+3-1
...@@ -1120,7 +1120,9 @@ pub const LibExeObjStep = struct {...@@ -1120,7 +1120,9 @@ pub const LibExeObjStep = struct {
1120 /// Add command line arguments with `addArg`.1120 /// Add command line arguments with `addArg`.
1121 pub fn run(exe: *LibExeObjStep) *RunStep {1121 pub fn run(exe: *LibExeObjStep) *RunStep {
1122 assert(exe.kind == Kind.Exe);1122 assert(exe.kind == Kind.Exe);
1123 assert(exe.target == Target.Native);1123 // It doesn't have to be native. We catch that if you actually try to run it.
1124 // Consider that this is declarative; the run step may not be run unless a user
1125 // option is supplied.
1124 const run_step = RunStep.create(exe.builder, exe.builder.fmt("run {}", exe.step.name));1126 const run_step = RunStep.create(exe.builder, exe.builder.fmt("run {}", exe.step.name));
1125 run_step.addArtifactArg(exe);1127 run_step.addArtifactArg(exe);
1126 return run_step;1128 return run_step;