Skip to content

Commit

Permalink
Expose jscruntime to be consumed via Prefab
Browse files Browse the repository at this point in the history
Summary:
This is the last library that we should expose via Prefab.
Thanks to cipolleschi 's work here moving the file to `/ReactCommon/jsc` folder
we can easily expose it to be consumed by third parties.

Changelog:
[Internal] [Changed] - Expose `jscruntime` to be consumed via Prefab

Reviewed By: cipolleschi

Differential Revision: D41534564

fbshipit-source-id: fb4b2d801def8caf71638dcb74eb87f8230984d4
  • Loading branch information
cortinico committed Nov 29, 2022
1 parent f283877 commit a7a43f8
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 20 deletions.
10 changes: 8 additions & 2 deletions ReactAndroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,19 @@ final def preparePrefab = tasks.register("preparePrefab", PreparePrefabHeadersTa
"rrc_image",
new Pair("../ReactCommon/react/renderer/components/image/", "react/renderer/components/image/")
),
// This prefab target is used by Expo & Reanimated to load a new instance of Hermes
// These prefab targets are used by Expo & Reanimated
new PrefabPreprocessingEntry(
"hermes-executor",
// "hermes-executor" is statically linking agaisnt "hermes-executor-common"
// "hermes-executor" is statically linking against "hermes-executor-common"
// and "hermes-inspector". Here we expose only the headers that we know are needed.
new Pair("../ReactCommon/hermes/inspector/", "hermes/inspector/")
),
new PrefabPreprocessingEntry(
"jscexecutor",
// "jscexecutor" is statically linking against "jscruntime"
// Here we expose only the headers that we know are needed.
new Pair("../ReactCommon/jsc/", "jsc/")
),
new PrefabPreprocessingEntry(
"react_render_uimanager",
new Pair("../ReactCommon/react/renderer/uimanager/", "react/renderer/uimanager/"),
Expand Down
1 change: 1 addition & 0 deletions ReactAndroid/src/main/jni/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ add_react_common_subdir(reactperflogger)
add_react_common_subdir(logger)
add_react_common_subdir(jsiexecutor)
add_react_common_subdir(cxxreact)
add_react_common_subdir(jsc)
add_react_common_subdir(jsi)
add_react_common_subdir(butter)
add_react_common_subdir(callinvoker)
Expand Down
9 changes: 7 additions & 2 deletions ReactCommon/jsc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,18 @@ add_compile_options(
-Wno-unused-lambda-capture
-DLOG_TAG=\"ReactNative\")

add_library(jscruntime STATIC
add_library(jscruntime
STATIC
JSCRuntime.h
JSCRuntime.cpp)

target_include_directories(jscruntime PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

target_link_libraries(jscruntime folly_runtime jsc glog)
target_link_libraries(jscruntime
folly_runtime
jsc
jsi
glog)

# TODO: Remove this flag when ready.
# Android has this enabled by default, but the flag is still needed for iOS.
Expand Down
16 changes: 0 additions & 16 deletions ReactCommon/jsi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,3 @@ target_include_directories(jsi PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(jsi
folly_runtime
glog)

##################
### jscruntime ###
##################

add_library(jscruntime STATIC
JSCRuntime.h
JSCRuntime.cpp)

target_include_directories(jscruntime PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

target_link_libraries(jscruntime folly_runtime jsc glog)

# TODO: Remove this flag when ready.
# Android has this enabled by default, but the flag is still needed for iOS.
target_compile_options(jscruntime PRIVATE -DRN_FABRIC_ENABLED)

0 comments on commit a7a43f8

Please sign in to comment.