diff --git a/sdks/hermes-engine/utils/build-apple-framework.sh b/sdks/hermes-engine/utils/build-apple-framework.sh index f1f1e421023e12..53695bda5f68e0 100755 --- a/sdks/hermes-engine/utils/build-apple-framework.sh +++ b/sdks/hermes-engine/utils/build-apple-framework.sh @@ -35,7 +35,7 @@ function build_host_hermesc { # Utility function to configure an Apple framework function configure_apple_framework { - local build_cli_tools enable_bitcode + local build_cli_tools enable_bitcode xcode_15_flags xcode_major_version if [[ $1 == iphoneos || $1 == catalyst ]]; then enable_bitcode="true" @@ -48,7 +48,14 @@ function configure_apple_framework { build_cli_tools="false" fi + xcode_15_flags="" + xcode_major_version=$(xcodebuild -version | grep -oE '[0-9]*' | head -n 1) + if [[ $xcode_major_version -ge 15 ]]; then + xcode_15_flags="LINKER:-ld_classic" + fi + cmake -S . -B "build_$1" \ + -DHERMES_EXTRA_LINKER_FLAGS="$xcode_15_flags" \ -DHERMES_APPLE_TARGET_PLATFORM:STRING="$1" \ -DCMAKE_OSX_ARCHITECTURES:STRING="$2" \ -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING="$3" \