ona/build.zig

51 lines
1.1 KiB
Zig
Executable File

const std = @import("std");
pub fn build(b: *std.Build) void {
const coral_module = b.createModule(.{.source_file = .{.path = "./source/coral/coral.zig"}});
const ona_module = b.createModule(.{
.source_file = .{.path = "./source/ona/ona.zig"},
.dependencies = &.{
.{
.name = "coral",
.module = coral_module,
},
},
});
const cross_target = b.standardTargetOptions(.{});
const optimize_mode = std.builtin.Mode.Debug;
// Ona runner.
{
const ona_exe = b.addExecutable(.{
.name = "ona-runner",
.root_source_file = .{.path = "./source/runner.zig"},
.target = cross_target,
.optimize = optimize_mode,
});
ona_exe.addModule("coral", coral_module);
ona_exe.addModule("ona", ona_module);
// ona_exe.addIncludeDir("./ext");
ona_exe.linkSystemLibrary("SDL2");
ona_exe.linkLibC();
b.installArtifact(ona_exe);
}
// Test step.
{
const exe_tests = b.addTest(.{
.root_source_file = .{.path = "source/test.zig"},
.target = cross_target,
.optimize = optimize_mode,
});
const test_step = b.step("test", "Run unit tests");
test_step.dependOn(&exe_tests.step);
}
}