From 9a0908bc6325f646371ca6171d0c6ca5b7bf0579 Mon Sep 17 00:00:00 2001 From: Emil Lerch Date: Sat, 12 Jun 2021 13:40:23 -0700 Subject: [PATCH] adjust build.zig for zig 0.9.0 >= c5d412268 --- build.zig | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/build.zig b/build.zig index d813ad5..9de709f 100644 --- a/build.zig +++ b/build.zig @@ -30,21 +30,13 @@ pub fn build(b: *Builder) void { exe.linkSystemLibrary("c"); exe.setTarget(target); exe.setBuildMode(mode); - exe.override_dest_dir = .{ .Custom = ".." }; - // TODO: Figure out -static - // Neither of these two work - // exe.addCompileFlags([][]const u8{ - // "-static", - // "--strip", - // }); - // - // To compile on stock 0.8.0, comment this line of code, or use the Makefile - // See https://github.com/ziglang/zig/pull/8248 - // - // On a musl-based x86_64 system, this pre-compiled zig can be used: - // https://github.com/elerch/zig/releases/download/0.8.0/zig-0.8.0-static-support-musl-libz.tgz - exe.is_static = true; + // This line works as of c5d412268 + // Earliest nightly is 05b5e49bc on 2021-06-12 + // https://ziglang.org/builds/zig-linux-x86_64-0.9.0-dev.113+05b5e49bc.tar.xz + // exe.override_dest_dir = .{ .Custom = ".." }; + exe.override_dest_dir = .{ .custom = ".." }; + exe.linkage = .static; exe.strip = true; exe.install();