Skip to content

Commit

Permalink
feat: Add RN 0.76 support (#265)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrousavy authored Oct 30, 2024
1 parent a5c76bd commit 309b424
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,21 @@ target_link_libraries(
${name}
fbjni::fbjni # <-- Facebook C++ JNI helpers
ReactAndroid::jsi # <-- RN: JSI
ReactAndroid::react_nativemodule_core # <-- RN: TurboModules Core
react-native-nitro-modules::NitroModules # <-- NitroModules Core :)
)
# Link react-native (different prefab between RN 0.75 and RN 0.76)
if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 76)
target_link_libraries(
${name}
ReactAndroid::reactnative # <-- RN: Native Modules umbrella prefab
)
else()
target_link_libraries(
${name}
ReactAndroid::react_nativemodule_core # <-- RN: TurboModules Core
)
endif()
`.trim()
return {
content: code,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ target_link_libraries(
NitroImage
fbjni::fbjni # <-- Facebook C++ JNI helpers
ReactAndroid::jsi # <-- RN: JSI
ReactAndroid::react_nativemodule_core # <-- RN: TurboModules Core
react-native-nitro-modules::NitroModules # <-- NitroModules Core :)
)

# Link react-native (different prefab between RN 0.75 and RN 0.76)
if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 76)
target_link_libraries(
NitroImage
ReactAndroid::reactnative # <-- RN: Native Modules umbrella prefab
)
else()
target_link_libraries(
NitroImage
ReactAndroid::react_nativemodule_core # <-- RN: TurboModules Core
)
endif()
14 changes: 13 additions & 1 deletion packages/react-native-nitro-modules/android/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,18 @@ target_link_libraries(
android # <-- Android JNI core
fbjni::fbjni # <-- Facebook C++ JNI helpers
ReactAndroid::jsi # <-- RN: JSI
)

# Link react-native (different prefab between RN 0.75 and RN 0.76)
if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 76)
target_link_libraries(
NitroModules
ReactAndroid::reactnative # <-- RN: Native Modules umbrella prefab
)
else()
target_link_libraries(
NitroModules
ReactAndroid::react_nativemodule_core # <-- RN: TurboModules Core
ReactAndroid::turbomodulejsijni # <-- RN: TurboModules utils (e.g. CallInvokerHolder)
)
)
endif()

0 comments on commit 309b424

Please sign in to comment.