From 1f93e872e4520c00ed8bab5798fddb5b9b257005 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Wed, 15 Apr 2026 13:45:38 -0700 Subject: [PATCH 1/2] fix: add macosx support to build-ios-framework.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.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 --- utils/build-ios-framework.sh | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/utils/build-ios-framework.sh b/utils/build-ios-framework.sh index 1d99eddf0a8..0f879e973a1 100644 --- a/utils/build-ios-framework.sh +++ b/utils/build-ios-framework.sh @@ -12,15 +12,9 @@ set -e # Given a specific target, retrieve the right architecture for it # $1 the target you want to build. Allowed values: iphoneos, iphonesimulator, catalyst, xros, xrsimulator function get_architecture { - if [[ $1 == "iphoneos" || $1 == "xros" ]]; then + if [[ $1 == "iphoneos" || $1 == "appletvos" || $1 == "xros" ]]; then echo "arm64" - elif [[ $1 == "iphonesimulator" || $1 == "xrsimulator" ]]; then - echo "x86_64;arm64" - elif [[ $1 == "appletvos" ]]; then - echo "arm64" - elif [[ $1 == "appletvsimulator" ]]; then - echo "x86_64;arm64" - elif [[ $1 == "catalyst" ]]; then + elif [[ $1 == "iphonesimulator" || $1 == "appletvsimulator" || $1 == "catalyst" || $1 == "macosx" || $1 == "xrsimulator" ]]; then echo "x86_64;arm64" else echo "Error: unknown architecture passed $1" @@ -29,7 +23,9 @@ function get_architecture { } function get_deployment_target { - if [[ $1 == "xros" || $1 == "xrsimulator" ]]; then + if [[ $1 == "macosx" ]]; then + echo "$(get_mac_deployment_target)" + elif [[ $1 == "xros" || $1 == "xrsimulator" ]]; then echo "$(get_visionos_deployment_target)" else # tvOS and iOS use the same deployment target echo "$(get_ios_deployment_target)" @@ -51,7 +47,7 @@ function build_framework { # group the frameworks together to create a universal framework function build_universal_framework { if [ ! -d destroot/Library/Frameworks/universal/hermesvm.xcframework ]; then - create_universal_framework "iphoneos" "iphonesimulator" "catalyst" "xros" "xrsimulator" "appletvos" "appletvsimulator" + create_universal_framework "macosx" "iphoneos" "iphonesimulator" "catalyst" "xros" "xrsimulator" "appletvos" "appletvsimulator" else echo "Skipping; Clean \"destroot\" to rebuild". fi @@ -61,6 +57,7 @@ function build_universal_framework { # this is used to preserve backward compatibility function create_framework { if [ ! -d destroot/Library/Frameworks/universal/hermesvm.xcframework ]; then + build_framework "macosx" build_framework "iphoneos" build_framework "iphonesimulator" build_framework "appletvos" From 20775561f3d7acc2072ac12714bd18064e4e9093 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Fri, 24 Apr 2026 11:33:53 -0700 Subject: [PATCH 2/2] Don't delete the macosx slices --- utils/build-apple-framework.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/utils/build-apple-framework.sh b/utils/build-apple-framework.sh index ac5ad6abad9..693065c6c5a 100755 --- a/utils/build-apple-framework.sh +++ b/utils/build-apple-framework.sh @@ -232,10 +232,12 @@ function create_universal_framework { # shellcheck disable=SC2086 if xcodebuild -create-xcframework $args -output "universal/hermesvm.xcframework" then - # # Remove the thin iOS hermesvm.frameworks that are now part of the universal - # XCFramework + # Remove the thin hermesvm.frameworks that are now part of the universal + # XCFramework, but keep macosx since it's expected as a standalone framework. for platform in "${platforms[@]}"; do - rm -r "$platform" + if [[ "$platform" != "macosx" ]]; then + rm -r "$platform" + fi done fi