std.Target: factor arch/abi into openbsd minimum version logic

This commit is contained in:
Alex Rønne Petersen 2025-11-30 22:37:47 +01:00
parent 6921ae8925
commit ac86650bf4
No known key found for this signature in database

View file

@ -533,7 +533,19 @@ pub const Os = struct {
}, },
.openbsd => .{ .openbsd => .{
.semver = .{ .semver = .{
.min = .{ .major = 7, .minor = 7, .patch = 0 }, .min = blk: {
const default_min: std.SemanticVersion = .{ .major = 7, .minor = 7, .patch = 0 };
for (std.zig.target.available_libcs) |libc| {
if (libc.arch != arch or libc.os != tag or libc.abi != abi) continue;
if (libc.os_ver) |min| {
if (min.order(default_min) == .gt) break :blk min;
}
}
break :blk default_min;
},
.max = .{ .major = 7, .minor = 8, .patch = 0 }, .max = .{ .major = 7, .minor = 8, .patch = 0 },
}, },
}, },