Add run option to the build.zig

This commit is contained in:
2026-05-21 21:49:14 +02:00
parent 9d1759fb87
commit d920e2c516
2 changed files with 15 additions and 1 deletions
+7 -1
View File
@@ -20,5 +20,11 @@ pub fn build(b: *std.Build) void {
});
exe.root_module.addImport("zigmulator", zigmulator);
b.installArtifact(exe);
const run_cmd = b.addRunArtifact(exe);
if (b.args) |args| {
run_cmd.addArgs(args);
}
const run_step = b.step("run", "Run the example");
run_step.dependOn(&run_cmd.step);
}