build: update for zig 0.11 and format

There was an API change to addInstallArtifact. It now takes a second
argument.
This commit is contained in:
torque 2023-08-04 00:07:41 -07:00
parent d1803284b4
commit 71653858ab
Signed by: torque
SSH Key Fingerprint: SHA256:nCrXefBNo6EbjNSQhv0nXmEg/VuNq3sMF5b8zETw3Tk

View File

@ -5,7 +5,7 @@ pub fn build(b: *std.Build) void {
const optimize: std.builtin.Mode = b.standardOptimizeOption(.{});
const noclip = b.addModule("noclip", .{
.source_file = .{ .path = "source/noclip.zig" }
.source_file = .{ .path = "source/noclip.zig" },
});
demo(b, noclip, target, optimize);
@ -21,7 +21,12 @@ pub fn build(b: *std.Build) void {
test_step.dependOn(&tests.step);
}
fn demo(b: *std.Build, noclip: *std.Build.Module, target: std.zig.CrossTarget, optimize: std.builtin.Mode) void {
fn demo(
b: *std.Build,
noclip: *std.Build.Module,
target: std.zig.CrossTarget,
optimize: std.builtin.Mode,
) void {
const demo_step = b.step("demo", "Build and install CLI demo program");
const exe = b.addExecutable(.{
@ -31,7 +36,7 @@ fn demo(b: *std.Build, noclip: *std.Build.Module, target: std.zig.CrossTarget, o
.optimize = optimize,
});
exe.addModule("noclip", noclip);
const install_demo = b.addInstallArtifact(exe);
const install_demo = b.addInstallArtifact(exe, .{});
demo_step.dependOn(&install_demo.step);
}