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(.{});