fix /usr/lib issues

pull/6699/head
Mitchell Hashimoto 2025-03-12 13:53:28 -07:00
parent 1f6aa0e90d
commit 99bde549af
No known key found for this signature in database
GPG Key ID: 523D5DC389D273BC
3 changed files with 6 additions and 3 deletions

View File

@ -277,7 +277,10 @@ pub fn add(
// on x86_64.
if (step.rootModuleTarget().os.tag == .linux) {
const triple = try step.rootModuleTarget().linuxTriple(b.allocator);
step.addLibraryPath(.{ .cwd_relative = b.fmt("/usr/lib/{s}", .{triple}) });
const path = b.fmt("/usr/lib/{s}", .{triple});
if (std.fs.accessAbsolute(path, .{})) {
step.addLibraryPath(.{ .cwd_relative = path });
} else |_| {}
}
// C files

View File

@ -4,7 +4,7 @@ const builtin = @import("builtin");
const options = @import("build_options");
comptime {
if (!builtin.target.isWasm()) {
if (!builtin.target.cpu.arch.isWasm()) {
@compileError("wasm.zig should only be analyzed for wasm32 builds");
}
}