mirror of
https://github.com/ziglang/zig.git
synced 2025-02-01 14:55:08 +00:00
std.Target.VersionRange: Make default() respect the minimum glibc version.
This commit is contained in:
parent
c339aa655e
commit
948bc91d12
@ -483,7 +483,21 @@ pub const Os = struct {
|
||||
.min = .{ .major = 4, .minor = 19, .patch = 0 },
|
||||
.max = .{ .major = 6, .minor = 5, .patch = 7 },
|
||||
},
|
||||
.glibc = .{ .major = 2, .minor = 28, .patch = 0 },
|
||||
.glibc = blk: {
|
||||
const default_min = .{ .major = 2, .minor = 28, .patch = 0 };
|
||||
|
||||
for (std.zig.target.available_libcs) |libc| {
|
||||
// We don't know the ABI here. We can get away with not checking it
|
||||
// for now, but that may not always remain true.
|
||||
if (libc.os != tag or libc.arch != arch) continue;
|
||||
|
||||
if (libc.glibc_min) |min| {
|
||||
if (min.order(default_min) == .gt) break :blk min;
|
||||
}
|
||||
}
|
||||
|
||||
break :blk default_min;
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user