From 074db7f4f6a61e4e9847c76a51ebc6669b5f6ed2 Mon Sep 17 00:00:00 2001 From: torque Date: Mon, 15 Jan 2024 22:45:59 -0800 Subject: [PATCH] build: update for zig-0.12.0-dev.2208+4debd4338 I may move this commit to a separate branch, since there are a variety of improvements that I think I want to get applied to the 0.11.x-compatible codebase still. However, I have also not been motivated to work on those fixes, since this codebase is kind of crusty due to being the first thing I ever wrote in zig. Doing a bigger rewrite might supply the motivation to make those improvements. I will have to think about it. For now, I am going to focus elsewhere. --- build.zig | 8 ++++---- build.zig.zon | 11 +++++++++++ 2 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 build.zig.zon diff --git a/build.zig b/build.zig index 5fe3d38..9547b62 100644 --- a/build.zig +++ b/build.zig @@ -1,11 +1,11 @@ const std = @import("std"); pub fn build(b: *std.Build) void { - const target: std.zig.CrossTarget = b.standardTargetOptions(.{}); + const target: std.Build.ResolvedTarget = b.standardTargetOptions(.{}); const optimize: std.builtin.Mode = b.standardOptimizeOption(.{}); const noclip = b.addModule("noclip", .{ - .source_file = .{ .path = "source/noclip.zig" }, + .root_source_file = .{ .path = "source/noclip.zig" }, }); demo(b, noclip, target, optimize); @@ -24,7 +24,7 @@ pub fn build(b: *std.Build) void { fn demo( b: *std.Build, noclip: *std.Build.Module, - target: std.zig.CrossTarget, + target: std.Build.ResolvedTarget, optimize: std.builtin.Mode, ) void { const demo_step = b.step("demo", "Build and install CLI demo program"); @@ -35,7 +35,7 @@ fn demo( .target = target, .optimize = optimize, }); - exe.addModule("noclip", noclip); + exe.root_module.addImport("noclip", noclip); const install_demo = b.addInstallArtifact(exe, .{}); demo_step.dependOn(&install_demo.step); diff --git a/build.zig.zon b/build.zig.zon new file mode 100644 index 0000000..082d363 --- /dev/null +++ b/build.zig.zon @@ -0,0 +1,11 @@ +.{ + .name = "NOCLIP", + .version = "0.1.0-pre", + .dependencies = .{}, + .paths = .{ + "source", + "build.zig", + "build.zig.zon", + "license", + }, +}