From 7d1116c5cc9b71086359ead2ace0d0d8a215b3a3 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Mon, 20 Nov 2023 19:13:22 +0100 Subject: [PATCH] Zig 0.12 compat --- build.zig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build.zig b/build.zig index 1e87e11..c10ffe0 100644 --- a/build.zig +++ b/build.zig @@ -18,7 +18,12 @@ pub fn build(b: *std.build.Builder) !void { minisign.addSystemIncludePath(.{ .path = "/opt/homebrew/include" }); minisign.addSystemIncludePath(.{ .path = "/usr/local/include" }); minisign.defineCMacro("_GNU_SOURCE", "1"); - minisign.addCSourceFiles(&.{ "src/base64.c", "src/get_line.c", "src/helpers.c", "src/minisign.c" }, &.{}); + const source_files = &.{ "src/base64.c", "src/get_line.c", "src/helpers.c", "src/minisign.c" }; + if (@hasDecl(std.Build.Step.Compile, "AddCSourceFilesOptions")) { + minisign.addCSourceFiles(.{ .files = source_files }); + } else { + minisign.addCSourceFiles(source_files, &.{}); + } b.installArtifact(minisign); }