Move libyoga.so and libturbomodulejsijni.so inside libreactnative.so (#46058)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46058

This moves other 2 libraries inside libreactnative.so

Changelog:
[Android] [Changed] - Move libyoga.so and libturbomodulejsijni.so inside libreactnative.so

Reviewed By: cipolleschi

Differential Revision: D61376499

fbshipit-source-id: 8780831491a5d57c4bb747fccf8a872ad30dc09e
This commit is contained in:
Nicola Corti
2024-08-16 05:42:46 -07:00
committed by Facebook GitHub Bot
parent e39aaf5da5
commit 80c3aea48d
11 changed files with 34 additions and 55 deletions
@@ -86,15 +86,13 @@ target_link_libraries(
react_codegen_${libraryName}
fbjni
jsi
# We need to link different libraries based on wether we are building rncore or not, that's necessary
# We need to link different libraries based on whether we are building rncore or not, that's necessary
# because we want to break a circular dependency between react_codegen_rncore and reactnative
${
libraryName !== 'rncore'
? 'reactnative'
: 'folly_runtime glog react_debug react_nativemodule_core react_render_componentregistry react_render_core react_render_debug react_render_graphics react_render_imagemanager react_render_mapbuffer react_utils rrc_image rrc_view'
: 'folly_runtime glog react_debug react_nativemodule_core react_render_componentregistry react_render_core react_render_debug react_render_graphics react_render_imagemanager react_render_mapbuffer react_utils rrc_image rrc_view turbomodulejsijni yoga'
}
turbomodulejsijni
yoga
)
target_compile_options(
@@ -56,11 +56,9 @@ target_link_libraries(
react_codegen_SampleWithUppercaseName
fbjni
jsi
# We need to link different libraries based on wether we are building rncore or not, that's necessary
# We need to link different libraries based on whether we are building rncore or not, that's necessary
# because we want to break a circular dependency between react_codegen_rncore and reactnative
reactnative
turbomodulejsijni
yoga
)
target_compile_options(
@@ -132,11 +130,9 @@ target_link_libraries(
react_codegen_complex_objects
fbjni
jsi
# We need to link different libraries based on wether we are building rncore or not, that's necessary
# We need to link different libraries based on whether we are building rncore or not, that's necessary
# because we want to break a circular dependency between react_codegen_rncore and reactnative
reactnative
turbomodulejsijni
yoga
)
target_compile_options(
@@ -201,11 +197,9 @@ target_link_libraries(
react_codegen_cxx_only_native_modules
fbjni
jsi
# We need to link different libraries based on wether we are building rncore or not, that's necessary
# We need to link different libraries based on whether we are building rncore or not, that's necessary
# because we want to break a circular dependency between react_codegen_rncore and reactnative
reactnative
turbomodulejsijni
yoga
)
target_compile_options(
@@ -277,11 +271,9 @@ target_link_libraries(
react_codegen_empty_native_modules
fbjni
jsi
# We need to link different libraries based on wether we are building rncore or not, that's necessary
# We need to link different libraries based on whether we are building rncore or not, that's necessary
# because we want to break a circular dependency between react_codegen_rncore and reactnative
reactnative
turbomodulejsijni
yoga
)
target_compile_options(
@@ -353,11 +345,9 @@ target_link_libraries(
react_codegen_event_emitter_module
fbjni
jsi
# We need to link different libraries based on wether we are building rncore or not, that's necessary
# We need to link different libraries based on whether we are building rncore or not, that's necessary
# because we want to break a circular dependency between react_codegen_rncore and reactnative
reactnative
turbomodulejsijni
yoga
)
target_compile_options(
@@ -429,11 +419,9 @@ target_link_libraries(
react_codegen_native_modules_with_type_aliases
fbjni
jsi
# We need to link different libraries based on wether we are building rncore or not, that's necessary
# We need to link different libraries based on whether we are building rncore or not, that's necessary
# because we want to break a circular dependency between react_codegen_rncore and reactnative
reactnative
turbomodulejsijni
yoga
)
target_compile_options(
@@ -513,11 +501,9 @@ target_link_libraries(
react_codegen_real_module_example
fbjni
jsi
# We need to link different libraries based on wether we are building rncore or not, that's necessary
# We need to link different libraries based on whether we are building rncore or not, that's necessary
# because we want to break a circular dependency between react_codegen_rncore and reactnative
reactnative
turbomodulejsijni
yoga
)
target_compile_options(
@@ -589,11 +575,9 @@ target_link_libraries(
react_codegen_simple_native_modules
fbjni
jsi
# We need to link different libraries based on wether we are building rncore or not, that's necessary
# We need to link different libraries based on whether we are building rncore or not, that's necessary
# because we want to break a circular dependency between react_codegen_rncore and reactnative
reactnative
turbomodulejsijni
yoga
)
target_compile_options(
@@ -673,11 +657,9 @@ target_link_libraries(
react_codegen_two_modules_different_files
fbjni
jsi
# We need to link different libraries based on wether we are building rncore or not, that's necessary
# We need to link different libraries based on whether we are building rncore or not, that's necessary
# because we want to break a circular dependency between react_codegen_rncore and reactnative
reactnative
turbomodulejsijni
yoga
)
target_compile_options(
@@ -21,7 +21,6 @@ target_link_libraries(
fbjni
jsi
reactnative
yoga
)
target_compile_options(
@@ -21,7 +21,6 @@ target_link_libraries(
fbjni
jsi
reactnative
yoga
)
target_compile_options(
@@ -80,8 +80,6 @@ val preparePrefab by
// migrate one library at a time.
input.set(
listOf(
PrefabPreprocessingEntry(
"turbomodulejsijni", Pair("src/main/jni/react/turbomodule", "")),
PrefabPreprocessingEntry(
"react_render_animations",
Pair("../ReactCommon/react/renderer/animations/", "react/renderer/animations/")),
@@ -127,11 +125,6 @@ val preparePrefab by
"react/renderer/textlayoutmanager/"),
Pair("../ReactCommon/react/renderer/textlayoutmanager/platform/android/", ""),
)),
PrefabPreprocessingEntry(
"yoga",
listOf(
Pair("../ReactCommon/yoga/", ""),
Pair("src/main/jni/first-party/yogajni/jni", ""))),
PrefabPreprocessingEntry(
"folly_runtime",
listOf(
@@ -333,6 +326,9 @@ val preparePrefab by
Pair("src/main/jni/react/jni", "react/jni/"),
// react_cxxreactpackage
Pair("src/main/jni/react/runtime/cxxreactpackage", ""),
// yoga
Pair("../ReactCommon/yoga/", ""),
Pair("src/main/jni/first-party/yogajni/jni", ""),
)),
))
outputDir.set(prefabHeadersDir)
@@ -617,7 +613,6 @@ android {
"react_render_core",
// prefab targets
"reactnativejni",
"turbomodulejsijni",
"react_featureflags",
"react_performance_timeline",
"react_utils",
@@ -632,7 +627,6 @@ android {
"jsi",
"react_render_mapbuffer",
"react_render_textlayoutmanager",
"yoga",
"react_render_uimanager",
"react_render_scheduler",
"react_render_mounting",
@@ -717,9 +711,6 @@ android {
}
prefab {
create("turbomodulejsijni") {
headers = File(prefabHeadersDir, "turbomodulejsijni").absolutePath
}
create("react_render_animations") {
headers = File(prefabHeadersDir, "react_render_animations").absolutePath
}
@@ -750,7 +741,6 @@ android {
create("react_render_textlayoutmanager") {
headers = File(prefabHeadersDir, "react_render_textlayoutmanager").absolutePath
}
create("yoga") { headers = File(prefabHeadersDir, "yoga").absolutePath }
create("react_render_uimanager") {
headers = File(prefabHeadersDir, "react_render_uimanager").absolutePath
}
@@ -65,11 +65,7 @@ target_compile_options(${CMAKE_PROJECT_NAME}
# Prefab packages from React Native
find_package(ReactAndroid REQUIRED CONFIG)
add_library(jsi ALIAS ReactAndroid::jsi)
add_library(react_render_mapbuffer ALIAS ReactAndroid::react_render_mapbuffer)
add_library(react_render_textlayoutmanager ALIAS ReactAndroid::react_render_textlayoutmanager)
add_library(reactnative ALIAS ReactAndroid::reactnative)
add_library(turbomodulejsijni ALIAS ReactAndroid::turbomodulejsijni)
add_library(yoga ALIAS ReactAndroid::yoga)
find_package(fbjni REQUIRED CONFIG)
add_library(fbjni ALIAS fbjni::fbjni)
@@ -78,8 +74,6 @@ target_link_libraries(${CMAKE_PROJECT_NAME}
fbjni # via 3rd party prefab
jsi # prefab ready
reactnative # prefab ready
turbomodulejsijni # prefab ready
yoga # prefab ready
)
# We use an interface target to propagate flags to all the generated targets
@@ -205,6 +205,8 @@ add_library(reactnative
$<TARGET_OBJECTS:rrc_textinput>
$<TARGET_OBJECTS:rrc_view>
$<TARGET_OBJECTS:runtimeexecutor>
$<TARGET_OBJECTS:turbomodulejsijni>
$<TARGET_OBJECTS:yoga>
)
target_merge_so(reactnative)
@@ -274,6 +276,8 @@ target_include_directories(reactnative
$<TARGET_PROPERTY:rrc_textinput,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:rrc_view,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:runtimeexecutor,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:turbomodulejsijni,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:yoga,INTERFACE_INCLUDE_DIRECTORIES>
)
# GTest dependencies
@@ -6,6 +6,8 @@
cmake_minimum_required(VERSION 3.13)
set(CMAKE_VERBOSE_MAKEFILE on)
include(${REACT_ANDROID_DIR}/src/main/jni/first-party/jni-lib-merge/SoMerging-utils.cmake)
add_compile_options(
-fvisibility=hidden
-fexceptions
@@ -14,8 +16,9 @@ add_compile_options(
-O3)
file(GLOB yoga_SRC CONFIGURE_DEPENDS jni/*.cpp)
add_library(yoga SHARED ${yoga_SRC})
add_library(yoga OBJECT ${yoga_SRC})
target_include_directories(yoga PUBLIC jni)
target_merge_so(yoga)
target_link_libraries(yoga yogacore fb fbjni log android)
@@ -40,10 +40,12 @@ target_link_libraries(callinvokerholder
### react_nativemodule_manager ###
##################################
include(${REACT_ANDROID_DIR}/src/main/jni/first-party/jni-lib-merge/SoMerging-utils.cmake)
# TODO: rename to react_nativemodule_manager
add_library(
turbomodulejsijni
SHARED
OBJECT
ReactCommon/BindingsInstallerHolder.cpp
ReactCommon/CompositeTurboModuleManagerDelegate.cpp
ReactCommon/OnLoad.cpp
@@ -51,6 +53,7 @@ add_library(
$<TARGET_OBJECTS:logger>
$<TARGET_OBJECTS:react_bridging>
)
target_merge_so(turbomodulejsijni)
target_include_directories(
turbomodulejsijni
@@ -23,6 +23,5 @@ target_include_directories(sampleturbomodule PUBLIC .)
target_link_libraries(sampleturbomodule
fbjni
jsi
turbomodulejsijni
reactnative
)
@@ -26,6 +26,8 @@ public object MergedSoMapping {
"react_featureflagsjni" -> "reactnative"
"react_newarchdefaults" -> "reactnative"
"rninstance" -> "reactnative"
"turbomodulejsijni" -> "reactnative"
"yoga" -> "reactnative"
else -> input
}
@@ -38,6 +40,8 @@ public object MergedSoMapping {
"react_newarchdefaults" -> libreact_newarchdefaults_so()
"reactnative" -> libreactnative_so()
"rninstance" -> librninstance_so()
"turbomodulejsijni" -> libturbomodulejsijni_so()
"yoga" -> libyoga_so()
}
}
@@ -54,4 +58,8 @@ public object MergedSoMapping {
public external fun libreactnative_so(): Int
public external fun librninstance_so(): Int
public external fun libturbomodulejsijni_so(): Int
public external fun libyoga_so(): Int
}