mirror of
https://github.com/ziglang/zig.git
synced 2025-12-16 03:03:09 +00:00
stf: do not call xcode-select or xcrun by absolute path in darwin sdk detection
This commit is contained in:
parent
6a4986b2d6
commit
92b20e4216
@ -15,7 +15,7 @@ pub const macos = @import("darwin/macos.zig");
|
|||||||
pub fn isSdkInstalled(allocator: Allocator) bool {
|
pub fn isSdkInstalled(allocator: Allocator) bool {
|
||||||
const result = std.process.Child.run(.{
|
const result = std.process.Child.run(.{
|
||||||
.allocator = allocator,
|
.allocator = allocator,
|
||||||
.argv = &.{ "/usr/bin/xcode-select", "--print-path" },
|
.argv = &.{ "xcode-select", "--print-path" },
|
||||||
}) catch return false;
|
}) catch return false;
|
||||||
|
|
||||||
defer {
|
defer {
|
||||||
@ -48,7 +48,7 @@ pub fn getSdk(allocator: Allocator, target: Target) ?[]const u8 {
|
|||||||
.visionos => if (is_simulator_abi) "xrsimulator" else "xros",
|
.visionos => if (is_simulator_abi) "xrsimulator" else "xros",
|
||||||
else => return null,
|
else => return null,
|
||||||
};
|
};
|
||||||
const argv = &[_][]const u8{ "/usr/bin/xcrun", "--sdk", sdk, "--show-sdk-path" };
|
const argv = &[_][]const u8{ "xcrun", "--sdk", sdk, "--show-sdk-path" };
|
||||||
const result = std.process.Child.run(.{ .allocator = allocator, .argv = argv }) catch return null;
|
const result = std.process.Child.run(.{ .allocator = allocator, .argv = argv }) catch return null;
|
||||||
defer {
|
defer {
|
||||||
allocator.free(result.stderr);
|
allocator.free(result.stderr);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user