authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-01-26 23:34:14+01:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-01-29 09:25:06+01:00
log7843deb16be3e28068398c1397345c8bb22ea6c6
treeda7c995b790947bfdef76ec633f430d70a523202
parente528ab4709a3703b74de3a0006a9c07f056d3600

std.zig.system.darwin: Add driverkit handling in getSdk().


1 files changed, 4 insertions(+), 3 deletions(-)

lib/std/zig/system/darwin.zig+4-3
...@@ -37,15 +37,16 @@ pub fn isSdkInstalled(allocator: Allocator) bool {...@@ -37,15 +37,16 @@ pub fn isSdkInstalled(allocator: Allocator) bool {
37pub fn getSdk(allocator: Allocator, target: Target) ?[]const u8 {37pub fn getSdk(allocator: Allocator, target: Target) ?[]const u8 {
38 const is_simulator_abi = target.abi == .simulator;38 const is_simulator_abi = target.abi == .simulator;
39 const sdk = switch (target.os.tag) {39 const sdk = switch (target.os.tag) {
40 .macos => "macosx",
41 .ios => switch (target.abi) {40 .ios => switch (target.abi) {
42 .simulator => "iphonesimulator",
43 .macabi => "macosx",41 .macabi => "macosx",
42 .simulator => "iphonesimulator",
44 else => "iphoneos",43 else => "iphoneos",
45 },44 },
46 .watchos => if (is_simulator_abi) "watchsimulator" else "watchos",45 .driverkit => "driverkit",
46 .macos => "macosx",
47 .tvos => if (is_simulator_abi) "appletvsimulator" else "appletvos",47 .tvos => if (is_simulator_abi) "appletvsimulator" else "appletvos",
48 .visionos => if (is_simulator_abi) "xrsimulator" else "xros",48 .visionos => if (is_simulator_abi) "xrsimulator" else "xros",
49 .watchos => if (is_simulator_abi) "watchsimulator" else "watchos",
49 else => return null,50 else => return null,
50 };51 };
51 const argv = &[_][]const u8{ "xcrun", "--sdk", sdk, "--show-sdk-path" };52 const argv = &[_][]const u8{ "xcrun", "--sdk", sdk, "--show-sdk-path" };