From 3b3078b21519c386704966b1282e46bdf86c3490 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ramos?= Date: Wed, 8 Jun 2022 13:34:31 -0700 Subject: [PATCH] Hermes: Use shared JSI from React Native on iOS (#33885) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/33885 When building Hermes for React Native, point to the React Native JSI location to ensure both React Native and Hermes use the exact same version of JSI. Changelog: [iOS] [Changed] - When Hermes is enabled, it will use the same copy of JSI as React Native Reviewed By: cipolleschi Differential Revision: D36567471 fbshipit-source-id: d0eb559aba603a0848a8b5474fbe01ce3ad103ff --- sdks/hermes-engine/utils/build-apple-framework.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sdks/hermes-engine/utils/build-apple-framework.sh b/sdks/hermes-engine/utils/build-apple-framework.sh index 364b067653b312..bd9365fdafd659 100755 --- a/sdks/hermes-engine/utils/build-apple-framework.sh +++ b/sdks/hermes-engine/utils/build-apple-framework.sh @@ -12,6 +12,8 @@ fi NUM_CORES=$(sysctl -n hw.ncpu) IMPORT_HERMESC_PATH=${HERMES_OVERRIDE_HERMESC_PATH:-$PWD/build_host_hermesc/ImportHermesc.cmake} +REACT_NATIVE_PATH=${REACT_NATIVE_PATH:-$PWD/../..} +JSI_PATH="$REACT_NATIVE_PATH/ReactCommon/jsi" function get_release_version { ruby -rcocoapods-core -rjson -e "puts Pod::Specification.from_file('hermes-engine.podspec').version" @@ -59,6 +61,8 @@ function configure_apple_framework { -DHERMES_BUILD_APPLE_DSYM:BOOLEAN=true \ -DHERMES_ENABLE_TOOLS:BOOLEAN="$build_cli_tools" \ -DIMPORT_HERMESC:PATH="$IMPORT_HERMESC_PATH" \ + -DJSI_DIR="$JSI_PATH" \ + -DHERMES_RELEASE_VERSION="for RN $(get_release_version)" \ -DCMAKE_INSTALL_PREFIX:PATH=../destroot \ -DCMAKE_BUILD_TYPE="$BUILD_TYPE" }