Backlog/lib/zgltf/build.zig

36 lines
1.0 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 zgltf = bh.MakeModlib(b, .{
.name = "zgltf",
.target = target,
.optimize = optimize,
.static_build = static_build,
.root = b.path("src/zgltf.zig"),
});
zgltf.install();
const tests = b.addTest(.{
.root_module = b.createModule(.{
.target = target,
.optimize = optimize,
.root_source_file = b.path("src/zgltf.zig"),
}),
});
tests.root_module.addImport("zgltf", zgltf.mod);
tests.root_module.linkLibrary(zgltf.lib);
b.installArtifact(tests);
var run_tests = b.addRunArtifact(tests);
const test_step = b.step("test", "Run tests");
test_step.dependOn(&run_tests.step);
}