From bbbfe71dc23e002ca44729234e232b7824be7569 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Sun, 25 Jun 2023 01:11:50 -0700 Subject: [PATCH] gpu-dawn: improve binary version selection Signed-off-by: Stephen Gutekanst --- libs/gpu-dawn/sdk.zig | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libs/gpu-dawn/sdk.zig b/libs/gpu-dawn/sdk.zig index 14581665..0804b013 100644 --- a/libs/gpu-dawn/sdk.zig +++ b/libs/gpu-dawn/sdk.zig @@ -220,11 +220,12 @@ pub fn Sdk(comptime deps: anytype) type { .macos => blk: { if (!target.cpu.arch.isX86() and !target.cpu.arch.isAARCH64()) break :blk false; - // If min. target macOS version is lesser than the min version we have available, then - // our binary is incompatible with the target. - const min_available = std.SemanticVersion{ .major = 11, .minor = 0, .patch = std.math.maxInt(u32) }; - if (target.os.version_range.semver.min.order(min_available) == .lt) break :blk false; - break :blk true; + // The minimum macOS version with which our binaries can be used. + const min_available = std.SemanticVersion{ .major = 11, .minor = 0, .patch = 0 }; + + // If the target version is >= the available version, then it's OK. + const order = target.os.version_range.semver.min.order(min_available); + break :blk (order == .gt or order == .eq); }, else => false, };