Skip to content

Commit 1a82cce

Browse files
committed
std.Target: Factor arch/ABI into NetBSD minimum OS version selection.
Based on data in std.zig.target.
1 parent a090ef0 commit 1a82cce

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
@@ -540,7 +540,19 @@ pub const Os = struct {
540540
},
541541
.netbsd => .{
542542
.semver = .{
543-
.min = .{ .major = 9, .minor = 4, .patch = 0 },
543+
.min = blk: {
544+
const default_min: std.SemanticVersion = .{ .major = 9, .minor = 4, .patch = 0 };
545+
546+
for (std.zig.target.available_libcs) |libc| {
547+
if (libc.arch != arch or libc.os != tag or libc.abi != abi) continue;
548+
549+
if (libc.os_ver) |min| {
550+
if (min.order(default_min) == .gt) break :blk min;
551+
}
552+
}
553+
554+
break :blk default_min;
555+
},
544556
.max = .{ .major = 10, .minor = 1, .patch = 0 },
545557
},
546558
},

0 commit comments

Comments
 (0)