39 lines
1.1 KiB
Zig
39 lines
1.1 KiB
Zig
const std = @import("std");
|
|
const sdl3 = @import("sdl3");
|
|
|
|
const dependencyList = [_][]const u8{
|
|
"core",
|
|
"sdl3",
|
|
};
|
|
|
|
pub fn build(b: *std.Build) void {
|
|
const target = b.standardTargetOptions(.{});
|
|
const optimize = b.standardOptimizeOption(.{});
|
|
|
|
const mod = b.addModule("platform", .{
|
|
.target = target,
|
|
.optimize = optimize,
|
|
.root_source_file = b.path("src/platform.zig"),
|
|
});
|
|
|
|
const tests = b.addTest(.{
|
|
.target = target,
|
|
.optimize = optimize,
|
|
.root_source_file = b.path("tests/tests.zig"),
|
|
});
|
|
|
|
for (dependencyList) |depName| {
|
|
const dep = b.dependency(depName, .{ .target = target, .optimize = optimize });
|
|
const dep_mod = dep.module(depName);
|
|
mod.addImport(depName, dep_mod);
|
|
tests.root_module.addImport(depName, dep_mod);
|
|
}
|
|
|
|
const test_step = b.step("test", "run unit tests for platform");
|
|
|
|
tests.root_module.addImport("platform", mod);
|
|
const runArtifact = b.addRunArtifact(tests);
|
|
test_step.dependOn(&runArtifact.step);
|
|
b.installArtifact(tests);
|
|
}
|