38 lines
1.1 KiB
Zig
38 lines
1.1 KiB
Zig
const std = @import("std");
|
|
const core = @import("core");
|
|
|
|
const depList = [_][]const u8{
|
|
"core",
|
|
"packer",
|
|
};
|
|
|
|
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 = "assets",
|
|
.target = target,
|
|
.optimize = optimize,
|
|
.static_build = static_build,
|
|
});
|
|
|
|
engineMod.linkModLibs(&depList);
|
|
engineMod.install();
|
|
|
|
const test_step = b.step("test", "run unit tests for assets");
|
|
const tests = b.addTest(.{
|
|
.root_module = b.createModule(.{
|
|
.target = target,
|
|
.optimize = optimize,
|
|
.root_source_file = b.path("tests/test.zig"),
|
|
}),
|
|
});
|
|
|
|
tests.root_module.addImport("assets", engineMod.mod);
|
|
const runArtifact = b.addRunArtifact(tests);
|
|
test_step.dependOn(&runArtifact.step);
|
|
b.installArtifact(tests);
|
|
}
|