Skip to content

Commit

Permalink
Merge libuimanagerjni.so inside libreactnative.so (#46056)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #46056

This merges another library inside libreactnative.so

Changelog:
[Android] [Changed] - Merge libuimanagerjni.so inside libreactnative.so

Reviewed By: cipolleschi

Differential Revision: D61376498

fbshipit-source-id: db646721a5a4b56f2cf098d5087a3e45d2076743
  • Loading branch information
cortinico authored and facebook-github-bot committed Aug 16, 2024
1 parent 6e5227b commit 7916f7e
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 4 deletions.
1 change: 0 additions & 1 deletion packages/react-native/ReactAndroid/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,6 @@ android {
"bridgeless",
"rninstance",
"hermesinstancejni",
"uimanagerjni",
"jscinstance",
"react_devsupportjni",
// prefab targets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ add_library(reactnative
SHARED
OnLoad.cpp
$<TARGET_OBJECTS:bridgeless>
$<TARGET_OBJECTS:bridgelessnativeviewconfig>
$<TARGET_OBJECTS:bridgelesshermes>
$<TARGET_OBJECTS:fabricjni>
$<TARGET_OBJECTS:hermes_inspector_modern>
Expand Down Expand Up @@ -197,6 +198,7 @@ add_library(reactnative
$<TARGET_OBJECTS:rrc_image>
$<TARGET_OBJECTS:rrc_legacyviewmanagerinterop>
$<TARGET_OBJECTS:rrc_modal>
$<TARGET_OBJECTS:rrc_native>
$<TARGET_OBJECTS:rrc_progressbar>
$<TARGET_OBJECTS:rrc_root>
$<TARGET_OBJECTS:rrc_scrollview>
Expand All @@ -206,6 +208,7 @@ add_library(reactnative
$<TARGET_OBJECTS:rrc_view>
$<TARGET_OBJECTS:runtimeexecutor>
$<TARGET_OBJECTS:turbomodulejsijni>
$<TARGET_OBJECTS:uimanagerjni>
$<TARGET_OBJECTS:yoga>
)
target_merge_so(reactnative)
Expand All @@ -224,6 +227,7 @@ target_link_libraries(reactnative PUBLIC
target_include_directories(reactnative
PUBLIC
$<TARGET_PROPERTY:bridgeless,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:bridgelessnativeviewconfig,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:bridgelesshermes,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:fabricjni,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:hermes_inspector_modern,INTERFACE_INCLUDE_DIRECTORIES>
Expand Down Expand Up @@ -268,6 +272,7 @@ target_include_directories(reactnative
$<TARGET_PROPERTY:rrc_image,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:rrc_legacyviewmanagerinterop,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:rrc_modal,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:rrc_native,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:rrc_progressbar,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:rrc_root,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:rrc_scrollview,INTERFACE_INCLUDE_DIRECTORIES>
Expand All @@ -277,6 +282,7 @@ target_include_directories(reactnative
$<TARGET_PROPERTY:rrc_view,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:runtimeexecutor,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:turbomodulejsijni,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:uimanagerjni,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:yoga,INTERFACE_INCLUDE_DIRECTORIES>
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@ set(CMAKE_VERBOSE_MAKEFILE on)

add_compile_options(-fexceptions -frtti -std=c++20 -Wall -DLOG_TAG=\"ReactNative\")

include(${REACT_ANDROID_DIR}/src/main/jni/first-party/jni-lib-merge/SoMerging-utils.cmake)

file(GLOB uimanagerjni_SRC CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
add_library(uimanagerjni
SHARED
OBJECT
${uimanagerjni_SRC}
$<TARGET_OBJECTS:react_render_graphics>
$<TARGET_OBJECTS:rrc_legacyviewmanagerinterop>
$<TARGET_OBJECTS:rrc_view>
)
target_merge_so(uimanagerjni)

target_include_directories(uimanagerjni PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ add_compile_options(
-DLOG_TAG=\"Fabric\")

file(GLOB rrc_native_SRC CONFIGURE_DEPENDS *.cpp)
add_library(rrc_native STATIC ${rrc_native_SRC})
add_library(rrc_native OBJECT ${rrc_native_SRC})

target_include_directories(rrc_native PUBLIC ${REACT_COMMON_DIR})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ add_compile_options(-std=c++20)
file(GLOB_RECURSE bridgeless_nativeviewconfig_SRC CONFIGURE_DEPENDS *.cpp)
add_library(
bridgelessnativeviewconfig
STATIC
OBJECT
${bridgeless_nativeviewconfig_SRC}
)
target_include_directories(bridgelessnativeviewconfig PUBLIC .)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public object MergedSoMapping {
"react_newarchdefaults" -> "reactnative"
"rninstance" -> "reactnative"
"turbomodulejsijni" -> "reactnative"
"uimanagerjni" -> "reactnative"
"yoga" -> "reactnative"
else -> input
}
Expand All @@ -41,6 +42,7 @@ public object MergedSoMapping {
"reactnative" -> libreactnative_so()
"rninstance" -> librninstance_so()
"turbomodulejsijni" -> libturbomodulejsijni_so()
"uimanagerjni" -> libuimanagerjni_so()
"yoga" -> libyoga_so()
}
}
Expand All @@ -61,5 +63,7 @@ public object MergedSoMapping {

public external fun libturbomodulejsijni_so(): Int

public external fun libuimanagerjni_so(): Int

public external fun libyoga_so(): Int
}

0 comments on commit 7916f7e

Please sign in to comment.