@@ -11,7 +11,7 @@ pub const macos = @import("darwin/macos.zig");
1111/// Therefore, we resort to the same tool used by Homebrew, namely, invoking `xcode-select --print-path`
1212/// and checking if the status is nonzero or the returned string in nonempty.
1313/// https://github.com/Homebrew/brew/blob/e119bdc571dcb000305411bc1e26678b132afb98/Library/Homebrew/brew.sh#L630
14- pub fn isDarwinSDKInstalled (allocator : Allocator ) bool {
14+ pub fn isSdkInstalled (allocator : Allocator ) bool {
1515 const argv = &[_ ][]const u8 { "/usr/bin/xcode-select" , "--print-path" };
1616 const result = std .ChildProcess .exec (.{ .allocator = allocator , .argv = argv }) catch return false ;
1717 defer {
@@ -29,7 +29,7 @@ pub fn isDarwinSDKInstalled(allocator: Allocator) bool {
2929/// Calls `xcrun --sdk <target_sdk> --show-sdk-path` which fetches the path to the SDK sysroot (if any).
3030/// Subsequently calls `xcrun --sdk <target_sdk> --show-sdk-version` which fetches version of the SDK.
3131/// The caller needs to deinit the resulting struct.
32- pub fn getDarwinSDK (allocator : Allocator , target : Target ) ? DarwinSDK {
32+ pub fn getSdk (allocator : Allocator , target : Target ) ? Sdk {
3333 const is_simulator_abi = target .abi == .simulator ;
3434 const sdk = switch (target .os .tag ) {
3535 .macos = > "macosx" ,
@@ -73,7 +73,7 @@ pub fn getDarwinSDK(allocator: Allocator, target: Target) ?DarwinSDK {
7373 };
7474 break :version version ;
7575 };
76- return DarwinSDK {
76+ return Sdk {
7777 .path = path ,
7878 .version = version ,
7979 };
@@ -96,11 +96,11 @@ fn parseSdkVersion(raw: []const u8) ?Version {
9696 return Version .parse (buffer [0.. len ]) catch null ;
9797}
9898
99- pub const DarwinSDK = struct {
99+ pub const Sdk = struct {
100100 path : []const u8 ,
101101 version : Version ,
102102
103- pub fn deinit (self : DarwinSDK , allocator : Allocator ) void {
103+ pub fn deinit (self : Sdk , allocator : Allocator ) void {
104104 allocator .free (self .path );
105105 }
106106};
0 commit comments