Functions
fn getSdk(allocator: Allocator, target: Target) ?Sdk
Detect SDK on Darwin. Calls
xcrun --sdk <target_sdk> --show-sdk-path
which fe…Detect SDK on Darwin. Calls
xcrun --sdk <target_sdk> --show-sdk-path
which fetches the path to the SDK sysroot (if any). Subsequently callsxcrun --sdk <target_sdk> --show-sdk-version
which fetches version of the SDK. The caller needs to deinit the resulting struct. stderr from xcrun is ignored. If error.OutOfMemory occurs in Allocator, this function returns null.fn isSdkInstalled(allocator: Allocator) bool
Check if SDK is installed on Darwin without triggering CLT installation popup wi…
Check if SDK is installed on Darwin without triggering CLT installation popup window. Note: simply invoking
xcrun
will inevitably trigger the CLT installation popup. Therefore, we resort to invokingxcode-select --print-path
and checking if the status is nonzero. stderr from xcode-select is ignored. If error.OutOfMemory occurs in Allocator, this function returns null.