ona/build.zig

55 lines
1.2 KiB
Zig
Executable File

const std = @import("std");
pub fn build(builder: *std.Build) void {
const coral_module = builder.createModule(.{.source_file = .{.path = "./source/coral/coral.zig"}});
const ona_module = builder.createModule(.{
.source_file = .{.path = "./source/ona/ona.zig"},
.dependencies = &.{
.{
.name = "coral",
.module = coral_module
},
},
});
const kym_module = builder.createModule(.{
.source_file = .{.path = "./source/kym/kym.zig"},
.dependencies = &.{
.{
.name = "coral",
.module = coral_module
},
},
});
// Ona Runner.
{
const ona_exe = builder.addExecutable(.{
.name = "ona-runner",
.root_source_file = .{.path = "./source/runner.zig"},
.target = builder.standardTargetOptions(.{}),
.optimize = .Debug,
});
ona_exe.addModule("coral", coral_module);
ona_exe.addModule("ona", ona_module);
ona_exe.addModule("kym", kym_module);
ona_exe.install();
// ona_exe.addIncludeDir("./ext");
ona_exe.linkSystemLibrary("SDL2");
ona_exe.linkLibC();
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);
}
}