From e4726532a1fc9ca6adc9e4f5eca20a51c64914b1 Mon Sep 17 00:00:00 2001 From: Vojtech Novak Date: Thu, 17 Oct 2024 14:20:58 +0200 Subject: [PATCH] fix: unblock build for 0.76 (#660) --- package/android/src/main/jni/CMakeLists.txt | 53 +++++++++++++-------- 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/package/android/src/main/jni/CMakeLists.txt b/package/android/src/main/jni/CMakeLists.txt index d338ae02..f720c8e8 100644 --- a/package/android/src/main/jni/CMakeLists.txt +++ b/package/android/src/main/jni/CMakeLists.txt @@ -37,27 +37,38 @@ target_include_directories( ${LIB_ANDROID_GENERATED_COMPONENTS_DIR} ) -target_link_libraries( - ${LIB_TARGET_NAME} - fbjni - folly_runtime - glog - jsi - react_codegen_rncore - react_debug - react_render_componentregistry - react_render_core - react_render_debug - react_render_graphics - react_render_imagemanager - react_render_mapbuffer - react_utils - react_nativemodule_core - rrc_image - turbomodulejsijni - rrc_view - yoga -) +# https://github.com/react-native-community/discussions-and-proposals/discussions/816 +# This if-then-else can be removed once this library does not support version below 0.76 +if (REACTNATIVE_MERGED_SO) + target_link_libraries( + ${LIB_TARGET_NAME} + fbjni + jsi + reactnative + ) +else() + target_link_libraries( + ${LIB_TARGET_NAME} + fbjni + folly_runtime + glog + jsi + react_codegen_rncore + react_debug + react_render_componentregistry + react_render_core + react_render_debug + react_render_graphics + react_render_imagemanager + react_render_mapbuffer + react_utils + react_nativemodule_core + rrc_image + turbomodulejsijni + rrc_view + yoga + ) +endif() target_compile_options( ${LIB_TARGET_NAME}