Skip to content

Commit f4a7219

Browse files
committed
Pass SDK name instead of path
1 parent 40016f1 commit f4a7219

File tree

1 file changed

+1
-14
lines changed
  • packages/react-native-node-api-cmake/src

1 file changed

+1
-14
lines changed

packages/react-native-node-api-cmake/src/apple.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,6 @@ export const APPLE_ARCHITECTURES = {
7070
"arm64-apple-visionos-sim": "arm64",
7171
} satisfies Record<AppleTriplet, AppleArchitecture>;
7272

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-
8573
export function createPlistContent(values: Record<string, string>) {
8674
return [
8775
'<?xml version="1.0" encoding="UTF-8"?>',
@@ -103,7 +91,6 @@ type AppleConfigureOptions = {
10391

10492
export function getAppleConfigureCmakeArgs({ triplet }: AppleConfigureOptions) {
10593
assert(isAppleTriplet(triplet));
106-
const sdkPath = getAppleSDKPath(triplet);
10794
const systemName = CMAKE_SYSTEM_NAMES[triplet];
10895

10996
return [
@@ -114,7 +101,7 @@ export function getAppleConfigureCmakeArgs({ triplet }: AppleConfigureOptions) {
114101
`CMAKE_SYSTEM_NAME=${systemName}`,
115102
// Set the SDK path for the target platform
116103
"-D",
117-
`CMAKE_OSX_SYSROOT=${sdkPath}`,
104+
`CMAKE_OSX_SYSROOT=${XCODE_SDK_NAMES[triplet]}`,
118105
// Set the target architecture
119106
"-D",
120107
`CMAKE_OSX_ARCHITECTURES=${APPLE_ARCHITECTURES[triplet]}`,

0 commit comments

Comments
 (0)