2022-11-20 12:54:26 -08:00
|
|
|
const std = @import("std");
|
|
|
|
|
|
|
|
pub fn build(b: *std.build.Builder) void {
|
|
|
|
const demo = b.step("demo", "noclip demo");
|
|
|
|
const tests = b.step("test", "Run unit tests");
|
|
|
|
|
|
|
|
const target = b.standardTargetOptions(.{});
|
2023-03-20 19:54:13 -07:00
|
|
|
const optimize = b.standardOptimizeOption(.{});
|
2022-11-20 12:54:26 -08:00
|
|
|
|
2023-03-20 19:54:13 -07:00
|
|
|
const exe = b.addSharedLibrary(.{
|
|
|
|
.name = "noclip",
|
|
|
|
.root_source_file = .{ .path = "source/noclip.zig" },
|
|
|
|
.target = target,
|
|
|
|
.optimize = optimize,
|
|
|
|
});
|
2022-11-20 12:54:26 -08:00
|
|
|
exe.install();
|
|
|
|
|
2023-03-20 19:54:13 -07:00
|
|
|
const demo_exe = b.addExecutable(.{
|
|
|
|
.name = "noclip-demo",
|
2023-03-25 16:08:59 -07:00
|
|
|
.root_source_file = .{ .path = "source/doodle.zig" },
|
2023-03-20 19:54:13 -07:00
|
|
|
});
|
2022-11-20 12:54:26 -08:00
|
|
|
const install_demo = b.addInstallArtifact(demo_exe);
|
|
|
|
demo.dependOn(&install_demo.step);
|
|
|
|
|
2023-03-20 19:54:13 -07:00
|
|
|
const lib_tests = b.addTest(.{
|
|
|
|
.name = "tests",
|
|
|
|
.root_source_file = .{ .path = "source/noclip.zig" },
|
|
|
|
.target = target,
|
|
|
|
.optimize = optimize,
|
|
|
|
});
|
2022-11-20 12:54:26 -08:00
|
|
|
|
|
|
|
tests.dependOn(&lib_tests.step);
|
|
|
|
}
|