Skip to content

Commit 76d47c1

Browse files
Saadnajmiclaude
andcommitted
fix: add macosx support to build-ios-framework-rn.sh and update CI
Address review feedback: - Add macosx to get_architecture, get_deployment_target, create_framework, and build_universal_framework in the -rn script - Route macosx through build-ios-framework-rn.sh in CI instead of build-mac-framework-rn.sh - Simplify get_architecture from 5 branches to 2 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b9d19c1 commit 76d47c1

2 files changed

Lines changed: 9 additions & 21 deletions

File tree

.github/workflows/build-apple-slices-hermes.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,8 @@ jobs:
4545
# HermesC is used to build hermes, so it has to be executable
4646
chmod +x ./build_host_hermesc/bin/hermesc
4747
48-
if [[ "$SLICE" == "macosx" ]]; then
49-
echo "[HERMES] Building Hermes for MacOS"
50-
51-
chmod +x ./utils/build-mac-framework-rn.sh
52-
BUILD_TYPE="${{ matrix.flavor }}" ./utils/build-mac-framework-rn.sh
53-
else
54-
echo "[HERMES] Building Hermes for iOS: $SLICE"
55-
56-
chmod +x ./utils/build-ios-framework-rn.sh
57-
BUILD_TYPE="${{ matrix.flavor }}" ./utils/build-ios-framework-rn.sh "$SLICE"
58-
fi
48+
chmod +x ./utils/build-ios-framework-rn.sh
49+
BUILD_TYPE="${{ matrix.flavor }}" ./utils/build-ios-framework-rn.sh "$SLICE"
5950
6051
echo "Moving from build_$SLICE to $FINAL_PATH"
6152
mv build_"$SLICE" "$FINAL_PATH"

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"

0 commit comments

Comments
 (0)