ona/build.zig

35 lines
965 B
Zig
Raw Normal View History

2022-08-10 15:52:16 +02:00
const std = @import("std");
pub fn build(builder: *std.build.Builder) void {
const target = builder.standardTargetOptions(.{});
const mode = builder.standardReleaseOptions();
// Ona executable.
{
const ona_exe = builder.addExecutable("ona", "./src/main.zig");
2022-08-10 15:52:16 +02:00
ona_exe.setTarget(target);
ona_exe.setBuildMode(mode);
ona_exe.install();
ona_exe.addIncludeDir("./ext");
2022-09-01 19:51:45 +02:00
ona_exe.linkSystemLibrary("SDL2");
2022-08-10 15:52:16 +02:00
const run_cmd = ona_exe.run();
run_cmd.step.dependOn(builder.getInstallStep());
if (builder.args) |args| run_cmd.addArgs(args);
builder.step("run", "Run Ona application").dependOn(&run_cmd.step);
}
// Ona tests.
{
const ona_tests = builder.addTestExe("test", "./src/main.zig");
2022-08-10 15:52:16 +02:00
ona_tests.setTarget(target);
ona_tests.setBuildMode(mode);
builder.step("test", "Run Ona unit tests").dependOn(&ona_tests.step);
}
}