chore: add build run command

This commit is contained in:
2022-04-22 12:12:55 -03:00
parent 55c4933ad7
commit ffddc43766
4 changed files with 11 additions and 4 deletions

3
.gitignore vendored
View File

@@ -2,4 +2,5 @@ zig-out/
zig-cache/
**/*.s
**/*.asm
**/*.asm
**/*.bin

3
.gitmodules vendored
View File

@@ -1,3 +1,4 @@
[submodule "lib/ZigGBA"]
path = lib/ZigGBA
url = https://github.com/wendigojaeger/ZigGBA
url = https://github.com/paoda/ZigGBA

View File

@@ -4,5 +4,10 @@ const GBABuilder = @import("lib/ZigGBA/GBA/builder.zig");
pub fn build(b: *std.build.Builder) void {
const exe = GBABuilder.addGBAExecutable(b, "first", "src/first.zig");
exe.emit_asm = if (b.option(bool, "asm", "emit assembly") orelse false) .emit else .default;
_ = exe;
const run_cmd = b.addSystemCommand(&.{"zba"});
if (b.args) |args| run_cmd.addArgs(args);
const run_step = b.step("run", "Run test ROM in ZBA");
run_step.dependOn(&run_cmd.step);
}