From 4dd6fbf632012c04d296c84ed5cb9b59beb1a6bb Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Wed, 29 Jan 2025 23:02:34 +0100 Subject: [PATCH] Use a list for possible include paths to be consistent with libraries --- build.zig | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/build.zig b/build.zig index ecefe62..caa7bdf 100644 --- a/build.zig +++ b/build.zig @@ -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 });