std.zig.LibCDirs: add openbsd support

This commit is contained in:
Alex Rønne Petersen 2025-11-30 22:34:52 +01:00
parent 6c9cc3450f
commit 0ea6bd08d8
No known key found for this signature in database
2 changed files with 9 additions and 0 deletions

View file

@ -176,6 +176,8 @@ pub fn detectFromBuilding(
std.zig.target.freebsdArchNameHeaders(target.cpu.arch)
else if (target.isNetBSDLibC())
std.zig.target.netbsdArchNameHeaders(target.cpu.arch)
else if (target.isOpenBSDLibC())
std.zig.target.openbsdArchNameHeaders(target.cpu.arch)
else
@tagName(target.cpu.arch);
const os_name = @tagName(target.os.tag);
@ -230,6 +232,7 @@ fn libCGenericName(target: *const std.Target) [:0]const u8 {
.driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => return "darwin",
.freebsd => return "freebsd",
.netbsd => return "netbsd",
.openbsd => return "openbsd",
else => {},
}
switch (target.abi) {

View file

@ -278,6 +278,12 @@ pub fn netbsdAbiNameHeaders(abi: std.Target.Abi) [:0]const u8 {
};
}
pub fn openbsdArchNameHeaders(arch: std.Target.Cpu.Arch) [:0]const u8 {
return switch (arch) {
else => @tagName(arch),
};
}
pub fn isLibCLibName(target: *const std.Target, name: []const u8) bool {
const ignore_case = target.os.tag.isDarwin() or target.os.tag == .windows;