Update for zig-master

This commit is contained in:
Frank Denis 2024-01-04 12:24:31 +01:00
parent 5f96819f44
commit 573988d235

View file

@ -1,6 +1,6 @@
const std = @import("std");
pub fn build(b: *std.build.Builder) !void {
pub fn build(b: *std.Build) !void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{ .preferred_optimize_mode = .ReleaseSmall });
@ -8,6 +8,7 @@ pub fn build(b: *std.build.Builder) !void {
.name = "minisign",
.target = target,
.optimize = optimize,
.strip = true,
});
minisign.linkLibC();
minisign.addLibraryPath(.{ .path = "/opt/homebrew/lib" });
@ -19,11 +20,7 @@ pub fn build(b: *std.build.Builder) !void {
minisign.addSystemIncludePath(.{ .path = "/usr/local/include" });
minisign.defineCMacro("_GNU_SOURCE", "1");
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, &.{});
}
minisign.addCSourceFiles(.{ .files = source_files });
b.installArtifact(minisign);
}