From 255fef5263afdf9933ba2f8a3dbcbca39ea9928a Mon Sep 17 00:00:00 2001 From: Neil Dhar Date: Tue, 14 Nov 2023 12:34:19 -0800 Subject: [PATCH] Build shared JSI by default (#41037) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/41037 Build JSI as a shared library by default. This avoids running into a problem with duplicate JSI when building against `libhermes` as a shared library. This is already the case for React Native on Android. For RN's iOS builds, explicitly specify that JSI should be statically linked. Changelog: [Internal] Reviewed By: dannysu Differential Revision: D50294405 fbshipit-source-id: 5e77e6d4ab77f8e338ca5ca4154e879eb3d616d7 --- .../sdks/hermes-engine/utils/build-apple-framework.sh | 1 + .../react-native/sdks/hermes-engine/utils/build-hermes-xcode.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh b/packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh index e530a99c0c9..a4fe7d79024 100755 --- a/packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh +++ b/packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh @@ -86,6 +86,7 @@ function configure_apple_framework { -DHERMES_ENABLE_TEST_SUITE:BOOLEAN=false \ -DHERMES_ENABLE_BITCODE:BOOLEAN=false \ -DHERMES_BUILD_APPLE_FRAMEWORK:BOOLEAN=true \ + -DHERMES_BUILD_SHARED_JSI:BOOLEAN=false \ -DHERMES_BUILD_APPLE_DSYM:BOOLEAN=true \ -DIMPORT_HERMESC:PATH="$IMPORT_HERMESC_PATH" \ -DJSI_DIR="$JSI_PATH" \ diff --git a/packages/react-native/sdks/hermes-engine/utils/build-hermes-xcode.sh b/packages/react-native/sdks/hermes-engine/utils/build-hermes-xcode.sh index 5bc340a1288..7d44c4cccb4 100755 --- a/packages/react-native/sdks/hermes-engine/utils/build-hermes-xcode.sh +++ b/packages/react-native/sdks/hermes-engine/utils/build-hermes-xcode.sh @@ -71,6 +71,7 @@ echo "Configure Apple framework" -DHERMES_ENABLE_TEST_SUITE:BOOLEAN=false \ -DHERMES_ENABLE_BITCODE:BOOLEAN=false \ -DHERMES_BUILD_APPLE_FRAMEWORK:BOOLEAN=true \ + -DHERMES_BUILD_SHARED_JSI:BOOLEAN=false \ -DHERMES_BUILD_APPLE_DSYM:BOOLEAN=true \ -DIMPORT_HERMESC:PATH="${hermesc_path}" \ -DJSI_DIR="$jsi_path" \