Skip to content

Commit

Permalink
Update cmake to support RN 0.76
Browse files Browse the repository at this point in the history
  • Loading branch information
mugikhan committed Nov 5, 2024
1 parent f731dc4 commit f9b1ef4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
29 changes: 19 additions & 10 deletions android/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
3 changes: 2 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ android {
"META-INF/**",
"**/libjsi.so",
"**/libreact_nativemodule_core.so",
"**/libturbomodulejsijni.so"
"**/libturbomodulejsijni.so",
"**/libreactnative.so"
]
}

Expand Down

0 comments on commit f9b1ef4

Please sign in to comment.