Use a list for possible include paths to be consistent with libraries

This commit is contained in:
Frank Denis 2025-01-29 23:02:34 +01:00
parent 41306e3e42
commit 4dd6fbf632

View file

@ -59,8 +59,11 @@ pub fn build(b: *std.Build) !void {
minisign.addLibraryPath(.{ .cwd_relative = path });
override_pkgconfig = true;
}
minisign.addSystemIncludePath(.{ .cwd_relative = "/opt/homebrew/include" });
minisign.addSystemIncludePath(.{ .cwd_relative = "/usr/local/include" });
for ([_][]const u8{ "/opt/homebrew/include", "/usr/local/include" }) |path| {
std.fs.accessAbsolute(path, .{}) catch continue;
minisign.addSystemIncludePath(.{ .cwd_relative = path });
}
for ([_][]const u8{ "/opt/homebrew/lib", "/usr/local/lib" }) |path| {
std.fs.accessAbsolute(path, .{}) catch continue;
minisign.addLibraryPath(.{ .cwd_relative = path });