NOCLIP/build.zig

37 lines
1.0 KiB
Zig
Raw Normal View History

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(.{});
const optimize = b.standardOptimizeOption(.{});
2022-11-20 12:54:26 -08: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();
const demo_exe = b.addExecutable(.{
.name = "noclip-demo",
.root_source_file = .{ .path = "demo/demo.zig" },
});
demo_exe.addModule("noclip", b.createModule(.{
.source_file = .{ .path = "source/noclip.zig" },
}));
2022-11-20 12:54:26 -08:00
const install_demo = b.addInstallArtifact(demo_exe);
demo.dependOn(&install_demo.step);
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);
}