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

master
Andrew Kelley 2019-03-19 17:08:50 -04:00
parent 9801a1df6a
commit ac34841270
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9
1 changed files with 3 additions and 1 deletions

View File

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