Skip to content

Commit 7da7fb9

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

File tree

1 file changed

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

1 file changed

+1
-15
lines changed

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

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import assert from "node:assert/strict";
2-
import cp from "node:child_process";
32
import fs from "node:fs";
43
import 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-
8572
export function createPlistContent(values: Record<string, string>) {
8673
return [
8774
'<?xml version="1.0" encoding="UTF-8"?>',
@@ -103,7 +90,6 @@ type AppleConfigureOptions = {
10390

10491
export 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

Comments
 (0)