Skip to content

Commit 36906cc

Browse files
Saadnajmiclaude
andcommitted
fix: add macosx support to build-ios-framework-rn.sh and simplify get_architecture
- Add macosx to get_architecture, get_deployment_target, create_framework, and build_universal_framework so the unified script handles all platforms - Simplify get_architecture from 5 branches to 2 - CI continues using build-mac-framework-rn.sh for the standalone macOS framework (needed by the podspec), while the assembly step now includes macosx in the universal xcframework via build_universal_framework Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f22ab30 commit 36906cc

2 files changed

Lines changed: 10 additions & 11 deletions

File tree

utils/build-ios-framework-rn.sh

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,9 @@ set -e
1212
# Given a specific target, retrieve the right architecture for it
1313
# $1 the target you want to build. Allowed values: iphoneos, iphonesimulator, catalyst, xros, xrsimulator
1414
function get_architecture {
15-
if [[ $1 == "iphoneos" || $1 == "xros" ]]; then
15+
if [[ $1 == "iphoneos" || $1 == "appletvos" || $1 == "xros" ]]; then
1616
echo "arm64"
17-
elif [[ $1 == "iphonesimulator" || $1 == "xrsimulator" ]]; then
18-
echo "x86_64;arm64"
19-
elif [[ $1 == "appletvos" ]]; then
20-
echo "arm64"
21-
elif [[ $1 == "appletvsimulator" ]]; then
22-
echo "x86_64;arm64"
23-
elif [[ $1 == "catalyst" ]]; then
17+
elif [[ $1 == "iphonesimulator" || $1 == "appletvsimulator" || $1 == "catalyst" || $1 == "macosx" || $1 == "xrsimulator" ]]; then
2418
echo "x86_64;arm64"
2519
else
2620
echo "Error: unknown architecture passed $1"
@@ -29,7 +23,9 @@ function get_architecture {
2923
}
3024

3125
function get_deployment_target {
32-
if [[ $1 == "xros" || $1 == "xrsimulator" ]]; then
26+
if [[ $1 == "macosx" ]]; then
27+
echo "$(get_mac_deployment_target)"
28+
elif [[ $1 == "xros" || $1 == "xrsimulator" ]]; then
3329
echo "$(get_visionos_deployment_target)"
3430
else # tvOS and iOS use the same deployment target
3531
echo "$(get_ios_deployment_target)"
@@ -53,7 +49,7 @@ function build_framework {
5349
# group the frameworks together to create a universal framework
5450
function build_universal_framework {
5551
if [ ! -d destroot/Library/Frameworks/universal/hermesvm.xcframework ]; then
56-
create_universal_framework "iphoneos" "iphonesimulator" "catalyst" "xros" "xrsimulator" "appletvos" "appletvsimulator"
52+
create_universal_framework "macosx" "iphoneos" "iphonesimulator" "catalyst" "xros" "xrsimulator" "appletvos" "appletvsimulator"
5753
else
5854
echo "Skipping; Clean \"destroot\" to rebuild".
5955
fi
@@ -63,6 +59,7 @@ function build_universal_framework {
6359
# this is used to preserve backward compatibility
6460
function create_framework {
6561
if [ ! -d destroot/Library/Frameworks/universal/hermesvm.xcframework ]; then
62+
build_framework "macosx"
6663
build_framework "iphoneos"
6764
build_framework "iphonesimulator"
6865
build_framework "appletvos"

utils/build-ios-framework.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77
. ./utils/build-apple-framework.sh
88

99
if [ ! -d destroot/Library/Frameworks/universal/hermes.xcframework ]; then
10+
mac_deployment_target=$(get_mac_deployment_target)
1011
ios_deployment_target=$(get_ios_deployment_target)
1112
visionos_deployment_target=$(get_visionos_deployment_target)
1213
tvos_deployment_target=$(get_tvos_deployment_target)
1314

15+
build_apple_framework "macosx" "x86_64;arm64" "$mac_deployment_target"
1416
build_apple_framework "iphoneos" "arm64" "$ios_deployment_target"
1517
build_apple_framework "iphonesimulator" "x86_64;arm64" "$ios_deployment_target"
1618
build_apple_framework "catalyst" "x86_64;arm64" "$ios_deployment_target"
@@ -19,7 +21,7 @@ if [ ! -d destroot/Library/Frameworks/universal/hermes.xcframework ]; then
1921
build_apple_framework "appletvos" "arm64" "$tvos_deployment_target"
2022
build_apple_framework "appletvsimulator" "x86_64;arm64" "$tvos_deployment_target"
2123

22-
create_universal_framework "iphoneos" "iphonesimulator" "catalyst" "xros" "xrsimulator" "appletvos" "appletvsimulator"
24+
create_universal_framework "macosx" "iphoneos" "iphonesimulator" "catalyst" "xros" "xrsimulator" "appletvos" "appletvsimulator"
2325
else
2426
echo "Skipping; Clean \"destroot\" to rebuild".
2527
fi

0 commit comments

Comments
 (0)