From ac34841270d34fb2f47ada2960d7281328ec7b25 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 19 Mar 2019 17:08:50 -0400 Subject: [PATCH] build.zig: allow run() on non-native target artifacts --- std/build.zig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/std/build.zig b/std/build.zig index 558372b7884e..0f88d09c2a6c 100644 --- a/std/build.zig +++ b/std/build.zig @@ -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;