Skip to content

Commit

Permalink
add comptime Zig version check
Browse files Browse the repository at this point in the history
Helps hexops/mach#1135

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
  • Loading branch information
slimsag committed Jan 13, 2024
1 parent 0fdefbd commit 10b1e64
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,10 @@ pub fn link(b: *std.Build, step: *std.Build.Step.Compile) void {
pub fn addPaths(step: *std.Build.Step.Compile) void {
@import("glfw").addPaths(step);
}

comptime {
const min_zig = std.SemanticVersion.parse("0.12.0-dev.2062+804cee3b9") catch unreachable;
if (builtin.zig_version.order(min_zig) != .eq) {
@compileError(std.fmt.comptimePrint("unsupported Zig version ({}). Required Zig version 2024.1.0-mach: https://machengine.org/about/nominated-zig/#202410-mach", .{builtin.zig_version}));
}
}

0 comments on commit 10b1e64

Please sign in to comment.