From f9b1ef4591c63ac02b23ad340561230cbc354afa Mon Sep 17 00:00:00 2001 From: Mugi Khan Date: Tue, 5 Nov 2024 12:01:16 +0200 Subject: [PATCH] Update cmake to support RN 0.76 --- android/CMakeLists.txt | 29 +++++++++++++++++++---------- android/build.gradle | 3 ++- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/android/CMakeLists.txt b/android/CMakeLists.txt index eb4db43..7ebbf13 100644 --- a/android/CMakeLists.txt +++ b/android/CMakeLists.txt @@ -50,23 +50,32 @@ set_target_properties( find_package(ReactAndroid REQUIRED CONFIG) find_package(fbjni REQUIRED CONFIG) find_package(powersync_sqlite_core REQUIRED CONFIG) -find_library(LOG_LIB log) - -if(${USE_HERMES}) - set(JSEXECUTOR_LIB ReactAndroid::hermes_executor) -else() - set(JSEXECUTOR_LIB ReactAndroid::jscexecutor) -endif() +find_library(LOG_LIB log) target_link_libraries( ${PACKAGE_NAME} ${LOG_LIB} fbjni::fbjni ReactAndroid::jsi - ReactAndroid::turbomodulejsijni - ReactAndroid::react_nativemodule_core - ${JSEXECUTOR_LIB} android powersync_sqlite_core::powersync ) + +if(REACTNATIVE_MERGED_SO OR ReactAndroid_VERSION_MINOR GREATER_EQUAL 76) + target_link_libraries( + ReactAndroid::reactnative + ) +else() + if(${USE_HERMES}) + set(JSEXECUTOR_LIB ReactAndroid::hermes_executor) + else() + set(JSEXECUTOR_LIB ReactAndroid::jscexecutor) + endif() + + target_link_libraries( + ReactAndroid::turbomodulejsijni + ReactAndroid::react_nativemodule_core + ${JSEXECUTOR_LIB} + ) +endif() diff --git a/android/build.gradle b/android/build.gradle index d12934e..1f26293 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -91,7 +91,8 @@ android { "META-INF/**", "**/libjsi.so", "**/libreact_nativemodule_core.so", - "**/libturbomodulejsijni.so" + "**/libturbomodulejsijni.so", + "**/libreactnative.so" ] }