41 lines
1.1 KiB
Zig
41 lines
1.1 KiB
Zig
const std = @import("std");
|
|
const core = @import("core");
|
|
|
|
const dependencyList = [_][]const u8{
|
|
"core",
|
|
"platform",
|
|
"rend",
|
|
"sdl3",
|
|
"cimgui",
|
|
};
|
|
|
|
pub fn build(b: *std.Build) void {
|
|
const target = b.standardTargetOptions(.{});
|
|
const optimize = b.standardOptimizeOption(.{});
|
|
const static_build = b.option(bool, "static_build", "builds backlog dependencies for static linking") orelse false;
|
|
|
|
const engineMod = core.MakeModLib(b, .{
|
|
.name = "imgui",
|
|
.target = target,
|
|
.optimize = optimize,
|
|
.static_build = static_build,
|
|
});
|
|
|
|
engineMod.linkModLibs(&dependencyList);
|
|
|
|
// ========== 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 imgui");
|
|
|
|
tests.root_module.addImport("platform", engineMod.mod);
|
|
const runArtifact = b.addRunArtifact(tests);
|
|
test_step.dependOn(&runArtifact.step);
|
|
b.installArtifact(tests);
|
|
}
|