Skip to content

Commit 0e3609b

Browse files
committed
std.Target: Factor arch/ABI into FreeBSD minimum OS version selection.
Based on data in std.zig.target.
1 parent eeaa1b1 commit 0e3609b

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

lib/std/Target.zig

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,19 @@ pub const Os = struct {
522522
},
523523
.freebsd => .{
524524
.semver = .{
525-
.min = .{ .major = 13, .minor = 4, .patch = 0 },
525+
.min = blk: {
526+
const default_min: std.SemanticVersion = .{ .major = 13, .minor = 4, .patch = 0 };
527+
528+
for (std.zig.target.available_libcs) |libc| {
529+
if (libc.arch != arch or libc.os != tag or libc.abi != abi) continue;
530+
531+
if (libc.os_ver) |min| {
532+
if (min.order(default_min) == .gt) break :blk min;
533+
}
534+
}
535+
536+
break :blk default_min;
537+
},
526538
.max = .{ .major = 14, .minor = 2, .patch = 0 },
527539
},
528540
},

0 commit comments

Comments
 (0)