Backlog/engine/ui/build.zig

44 lines
1.5 KiB
Zig

const std = @import("std");
const sdl3 = @import("sdl3");
const core = @import("core");
const dependencyList = [_][]const u8{
"core",
"platform",
"rend",
"papyrus",
"shaderTypes",
"sdl3",
};
pub fn build(b: *std.Build) void {
const engineMod = core.MakeEngineMod(b, "ui");
engineMod.linkModLibs(&dependencyList);
engineMod.install();
const target = engineMod.target;
const optimize = engineMod.optimize;
// shaders
sdl3.shaderDefintion(b, engineMod.mod, "../../lib/sdl3", target, optimize, "rect.vert", b.path("shaders/rect.vert.json"));
sdl3.shaderDefintion(b, engineMod.mod, "../../lib/sdl3", target, optimize, "rect.frag", b.path("shaders/rect.frag.json"));
sdl3.shaderDefintion(b, engineMod.mod, "../../lib/sdl3", target, optimize, "text.vert", b.path("shaders/text.vert.json"));
sdl3.shaderDefintion(b, engineMod.mod, "../../lib/sdl3", target, optimize, "text.frag", b.path("shaders/text.frag.json"));
// ========== tests ==========
const tests = b.addTest(.{
.root_module = b.createModule(.{
.target = target,
.optimize = optimize,
.root_source_file = b.path("tests/tests.zig"),
}),
});
const test_step = b.step("test", "run unit tests for ui");
tests.root_module.addImport("ui", engineMod.mod);
tests.root_module.linkLibrary(engineMod.lib);
const runArtifact = b.addRunArtifact(tests);
test_step.dependOn(&runArtifact.step);
b.installArtifact(tests);
}