From 2294dc8832dce6b68ec61c5a0edb86817e4ab1c4 Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Tue, 29 Nov 2022 23:10:29 -0400 Subject: [PATCH] chore: add minimum zig version --- build.zig | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build.zig b/build.zig index 746f2bf..ccfb38a 100644 --- a/build.zig +++ b/build.zig @@ -1,7 +1,15 @@ const std = @import("std"); +const builtin = @import("builtin"); const Sdk = @import("lib/SDL.zig/Sdk.zig"); pub fn build(b: *std.build.Builder) void { + // Minimum Zig Version + const min_ver = std.SemanticVersion.parse("0.11.0-dev.323+30eb2a175") catch return; // https://github.com/ziglang/zig/commit/30eb2a175 + if (builtin.zig_version.order(min_ver).compare(.lt)) { + std.log.err("{s}", .{b.fmt("Zig v{} does not meet the minimum version requirement. (Zig v{})", .{ builtin.zig_version, min_ver })}); + std.os.exit(1); + } + // Standard target options allows the person running `zig build` to choose // what target to build for. Here we do not override the defaults, which // means any target is allowed, and the default is native. Other options