34 lines
1.1 KiB
Zig
34 lines
1.1 KiB
Zig
const std = @import("std");
|
|
const bh = @import("bh");
|
|
|
|
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 objLoader = bh.MakeModLib(b, .{
|
|
.name = "objLoader",
|
|
.target = target,
|
|
.optimize = optimize,
|
|
.static_build = static_build,
|
|
.root = b.path("src/obj_loader.zig"),
|
|
});
|
|
|
|
objLoader.install();
|
|
|
|
const test_step = b.step("test", "");
|
|
const tests = b.addTest(.{
|
|
.root_module = b.createModule(.{
|
|
.target = target,
|
|
.optimize = optimize,
|
|
.root_source_file = b.path("src/obj_loader.zig"),
|
|
.link_libc = true,
|
|
}),
|
|
});
|
|
|
|
tests.root_module.addImport("objLoader", objLoader.mod);
|
|
tests.root_module.linkLibrary(objLoader.lib);
|
|
const runArtifact = b.addRunArtifact(tests);
|
|
test_step.dependOn(&runArtifact.step);
|
|
}
|