11import assert from "node:assert/strict" ;
2- import cp from "node:child_process" ;
32import fs from "node:fs" ;
43import path from "node:path" ;
54
@@ -70,18 +69,6 @@ export const APPLE_ARCHITECTURES = {
7069 "arm64-apple-visionos-sim" : "arm64" ,
7170} satisfies Record < AppleTriplet , AppleArchitecture > ;
7271
73- export function getAppleSDKPath ( triplet : AppleTriplet ) {
74- return cp
75- . spawnSync (
76- "xcrun" ,
77- [ "--sdk" , XCODE_SDK_NAMES [ triplet ] , "--show-sdk-path" ] ,
78- {
79- encoding : "utf-8" ,
80- }
81- )
82- . stdout . trim ( ) ;
83- }
84-
8572export function createPlistContent ( values : Record < string , string > ) {
8673 return [
8774 '<?xml version="1.0" encoding="UTF-8"?>' ,
@@ -103,7 +90,6 @@ type AppleConfigureOptions = {
10390
10491export function getAppleConfigureCmakeArgs ( { triplet } : AppleConfigureOptions ) {
10592 assert ( isAppleTriplet ( triplet ) ) ;
106- const sdkPath = getAppleSDKPath ( triplet ) ;
10793 const systemName = CMAKE_SYSTEM_NAMES [ triplet ] ;
10894
10995 return [
@@ -114,7 +100,7 @@ export function getAppleConfigureCmakeArgs({ triplet }: AppleConfigureOptions) {
114100 `CMAKE_SYSTEM_NAME=${ systemName } ` ,
115101 // Set the SDK path for the target platform
116102 "-D" ,
117- `CMAKE_OSX_SYSROOT=${ sdkPath } ` ,
103+ `CMAKE_OSX_SYSROOT=${ XCODE_SDK_NAMES [ triplet ] } ` ,
118104 // Set the target architecture
119105 "-D" ,
120106 `CMAKE_OSX_ARCHITECTURES=${ APPLE_ARCHITECTURES [ triplet ] } ` ,
0 commit comments