From 466b044bba26e151a80863e4e0c847bf838a545a Mon Sep 17 00:00:00 2001 From: Krzysztof Wolicki Date: Wed, 29 Nov 2023 18:17:18 +0100 Subject: [PATCH] Add required_zig_version back --- build.zig | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build.zig b/build.zig index 58067fc..fd5a468 100644 --- a/build.zig +++ b/build.zig @@ -5,6 +5,8 @@ const CompileStep = std.Build.Step.Compile; /// set this to true to link libc const should_link_libc = false; +const required_zig_version = std.SemanticVersion.parse("0.12.0-dev.1754+2a3226453") catch unreachable; + fn linkObject(b: *Build, obj: *CompileStep) void { if (should_link_libc) obj.linkLibC(); _ = b; @@ -13,6 +15,11 @@ fn linkObject(b: *Build, obj: *CompileStep) void { } pub fn build(b: *Build) void { + if (comptime @import("builtin").zig_version.order(required_zig_version) == .lt) { + std.debug.print("Warning: Your version of Zig too old. You will need to download a newer build\n", .{}); + std.os.exit(1); + } + const target = b.standardTargetOptions(.{}); const mode = b.standardOptimizeOption(.{});