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.
|
|
|
|
{
|
2022-10-02 13:56:19 +02:00
|
|
|
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();
|
2022-08-10 17:38:50 +02:00
|
|
|
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.
|
|
|
|
{
|
2022-10-02 13:56:19 +02:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|