From 108ea640ba92f1486841e747573017c282df7280 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Tue, 11 Mar 2025 19:06:46 +0100 Subject: [PATCH] Require Zig 0.14 --- build.zig | 37 ++++++++++++++----------------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/build.zig b/build.zig index 080790a..410a936 100644 --- a/build.zig +++ b/build.zig @@ -15,35 +15,26 @@ pub fn build(b: *std.Build) !void { .strip = true, }); + if (builtin.zig_version.major == 0 and builtin.zig_version.minor < 14) { + @compileError("Building requires Zig 0.14.0 or later"); + } + // fix Mach-O relocation minisign.headerpad_max_install_names = true; minisign.linkLibC(); if (use_libzodium) { var libzodium = lib: { - if (builtin.zig_version.major == 0 and builtin.zig_version.minor < 13) { - @compileError("Building requires Zig 0.13.0 or later"); - } - if (builtin.zig_version.major == 0 and builtin.zig_version.minor == 13) { - break :lib b.addStaticLibrary(.{ - .name = "zodium", - .strip = true, - .root_source_file = b.path("src/libzodium/libzodium.zig"), - .target = target, - .optimize = optimize, - }); - } else { - const libzodium_mod = b.createModule(.{ - .root_source_file = b.path("src/libzodium/libzodium.zig"), - .target = target, - .optimize = optimize, - }); - break :lib b.addStaticLibrary(.{ - .name = "zodium", - .root_module = libzodium_mod, - .strip = true, - }); - } + const libzodium_mod = b.createModule(.{ + .root_source_file = b.path("src/libzodium/libzodium.zig"), + .target = target, + .optimize = optimize, + }); + break :lib b.addStaticLibrary(.{ + .name = "zodium", + .root_module = libzodium_mod, + .strip = true, + }); }; libzodium.linkLibC(); b.installArtifact(libzodium);