fix: Avoid duplicate C++ symbols by using libjsi.so shared library (#494)

* fix: Avoid duplicate C++ symbols by using `libjsi.so` shared library

* exclude `libfbjni` and `libjsi` from packaging options
This commit is contained in:
Marc Rousavy 2021-10-07 11:16:19 +02:00 committed by GitHub
parent bad9f99ac7
commit fc43b1bb7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 10 deletions

View File

@ -81,11 +81,6 @@ else()
file (GLOB LIBREANIMATED_DIR "${BUILD_DIR}/react-native-reanimated-*-jsc.aar/jni/${ANDROID_ABI}") file (GLOB LIBREANIMATED_DIR "${BUILD_DIR}/react-native-reanimated-*-jsc.aar/jni/${ANDROID_ABI}")
endif() endif()
find_library(
LOG_LIB
log
)
find_library( find_library(
FBJNI_LIB FBJNI_LIB
fbjni fbjni
@ -93,12 +88,11 @@ find_library(
NO_CMAKE_FIND_ROOT_PATH NO_CMAKE_FIND_ROOT_PATH
) )
find_library( find_library(
REANIMATED_LIB JSI_LIB
reanimated jsi
PATHS ${LIBREANIMATED_DIR} PATHS ${LIBRN_DIR}
NO_CMAKE_FIND_ROOT_PATH NO_CMAKE_FIND_ROOT_PATH
) )
find_library( find_library(
FOLLY_JSON_LIB FOLLY_JSON_LIB
folly_json folly_json
@ -113,12 +107,25 @@ find_library(
NO_CMAKE_FIND_ROOT_PATH NO_CMAKE_FIND_ROOT_PATH
) )
find_library(
REANIMATED_LIB
reanimated
PATHS ${LIBREANIMATED_DIR}
NO_CMAKE_FIND_ROOT_PATH
)
find_library(
LOG_LIB
log
)
# linking # linking
message(WARNING "VisionCamera linking: FOR_HERMES=${FOR_HERMES}") message(WARNING "VisionCamera linking: FOR_HERMES=${FOR_HERMES}")
target_link_libraries( target_link_libraries(
${PACKAGE_NAME} ${PACKAGE_NAME}
${LOG_LIB} ${LOG_LIB}
${JSI_LIB}
${JS_ENGINE_LIB} # <-- Hermes or JSC ${JS_ENGINE_LIB} # <-- Hermes or JSC
${REANIMATED_LIB} ${REANIMATED_LIB}
${REACT_NATIVE_JNI_LIB} ${REACT_NATIVE_JNI_LIB}

View File

@ -112,7 +112,7 @@ android {
} }
packagingOptions { packagingOptions {
excludes = ["**/libc++_shared.so", "**/libfbjni.so"] excludes = ["**/libc++_shared.so", "**/libfbjni.so", "**/libjsi.so"]
} }
buildTypes { buildTypes {