Skip to content

Commit

Permalink
Update CMakeLists.txt to resolve "react-native"
Browse files Browse the repository at this point in the history
This enables end-users to build the iOS XCFramework locally from our npm package, if they need it built with the same version of Xcode as they're using to build their app.
  • Loading branch information
kraenhansen authored Mar 31, 2022
1 parent 09f77f7 commit 9ad22a7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/jsi/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
set(REACT_NATIVE_ROOT_DIR "${PACKAGE_ROOT_DIR}/node_modules/react-native")
# Using Node.js to resolve the path to the "react-native" package.
# This enables building for iOS on the end-users machine,
# where "react-native" is installed as a sibling to our package instead of being a dev-dependency of our package.

execute_process(
COMMAND node --print "path.dirname(require.resolve('react-native/package.json'))"
OUTPUT_VARIABLE REACT_NATIVE_ROOT_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(JSI_HEADER_DIR "${REACT_NATIVE_ROOT_DIR}/ReactCommon/jsi")
message(STATUS "Getting JSI headers from ${JSI_HEADER_DIR}")

add_library(realm-js-hermes OBJECT
jsi_init.cpp
Expand Down

0 comments on commit 9ad22a7

Please sign in to comment.