ona/build.zig

45 lines
1018 B
Zig
Raw Normal View History

2023-04-19 01:25:35 +02:00
const std = @import("std");
2023-05-28 03:26:41 +02:00
pub fn build(b: *std.Build) void {
2023-07-10 02:10:56 +02:00
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
2023-05-28 03:26:41 +02:00
const coral_module = b.createModule(.{.source_file = .{.path = "./source/coral/coral.zig"}});
2023-04-19 01:25:35 +02:00
2023-05-28 03:26:41 +02:00
const ona_module = b.createModule(.{
2023-04-19 01:25:35 +02:00
.source_file = .{.path = "./source/ona/ona.zig"},
.dependencies = &.{
.{
.name = "coral",
.module = coral_module,
2023-04-19 01:25:35 +02:00
},
},
});
2023-07-10 02:10:56 +02:00
b.installArtifact(create: {
2023-07-11 00:44:27 +02:00
const compile_step = b.addExecutable(.{
2023-07-10 02:10:56 +02:00
.name = "runner",
.root_source_file = .{ .path = "source/runner.zig" },
.target = target,
.optimize = optimize,
2023-04-19 01:25:35 +02:00
});
2023-07-11 00:44:27 +02:00
compile_step.addModule("ona", ona_module);
compile_step.linkLibC();
compile_step.linkSystemLibrary("SDL2");
2023-04-19 01:25:35 +02:00
2023-07-11 00:44:27 +02:00
break: create compile_step;
});
b.step("test", "Run unit tests").dependOn(create: {
const tests = b.addTest(.{
.root_source_file = .{.path = "source/test.zig"},
.target = target,
.optimize = optimize,
});
break: create &tests.step;
2023-07-10 02:10:56 +02:00
});
2023-04-19 01:25:35 +02:00
}