Skip to content

Commit

Permalink
Updated Android Cmake link configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
kraenhansen committed Oct 28, 2024
1 parent 6d56419 commit de7186f
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions packages/realm/binding/android/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,25 @@ target_link_libraries(realm-js-android-binding
Realm::ObjectStore
Realm::Sync
ReactAndroid::jsi
ReactAndroid::reactnativejni
ReactAndroid::turbomodulejsijni
fbjni::fbjni
)

# This if-then-else can be removed once this library does not support version below 0.76
# Ideally we would just depend on `REACTNATIVE_MERGED_SO`
# See https://github.com/react-native-community/discussions-and-proposals/discussions/816
# For some reason (yet to be determined) we don't have REACTNATIVE_MERGED_SO set here.
# See https://github.com/react-native-community/discussions-and-proposals/discussions/816#discussioncomment-10659654
if (REACTNATIVE_MERGED_SO OR ReactAndroid_VERSION_MINOR GREATER_EQUAL 76)
target_link_libraries(realm-js-android-binding
ReactAndroid::reactnative
)
else()
target_link_libraries(realm-js-android-binding
ReactAndroid::reactnativejni
ReactAndroid::turbomodulejsijni
)
endif()

if (CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
add_custom_command(TARGET realm-js-android-binding
POST_BUILD
Expand Down

0 comments on commit de7186f

Please sign in to comment.