fix: Fix "REACT_NATIVE_UTILS_LIB
not found" build error (#295)
* Remove `REACT_NATIVE_UTILS_LIB` * Clean up CMakeLists.txt
This commit is contained in:
parent
01104e0932
commit
5eaed05f47
@ -54,12 +54,32 @@ target_include_directories(
|
|||||||
# find libraries
|
# find libraries
|
||||||
|
|
||||||
file (GLOB LIBRN_DIR "${BUILD_DIR}/react-native-0*/jni/${ANDROID_ABI}")
|
file (GLOB LIBRN_DIR "${BUILD_DIR}/react-native-0*/jni/${ANDROID_ABI}")
|
||||||
file (GLOB LIBJSC_DIR "${BUILD_DIR}/android-jsc*.aar/jni/${ANDROID_ABI}")
|
|
||||||
file (GLOB LIBHERMES_DIR "${BUILD_DIR}/third-party-ndk/hermes/jni/${ANDROID_ABI}")
|
|
||||||
|
|
||||||
if(${FOR_HERMES})
|
if(${FOR_HERMES})
|
||||||
|
else()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(${FOR_HERMES})
|
||||||
|
file (GLOB LIBHERMES_DIR "${BUILD_DIR}/third-party-ndk/hermes/jni/${ANDROID_ABI}")
|
||||||
|
# Use Hermes
|
||||||
|
find_library(
|
||||||
|
JS_ENGINE_LIB
|
||||||
|
hermes
|
||||||
|
PATHS ${LIBHERMES_DIR}
|
||||||
|
NO_CMAKE_FIND_ROOT_PATH
|
||||||
|
)
|
||||||
|
# Use Reanimated Hermes
|
||||||
file (GLOB LIBREANIMATED_DIR "${BUILD_DIR}/react-native-reanimated-*-hermes.aar/jni/${ANDROID_ABI}")
|
file (GLOB LIBREANIMATED_DIR "${BUILD_DIR}/react-native-reanimated-*-hermes.aar/jni/${ANDROID_ABI}")
|
||||||
else()
|
else()
|
||||||
|
file (GLOB LIBJSC_DIR "${BUILD_DIR}/android-jsc*.aar/jni/${ANDROID_ABI}")
|
||||||
|
# Use JSC
|
||||||
|
find_library(
|
||||||
|
JS_ENGINE_LIB
|
||||||
|
jscexecutor
|
||||||
|
PATHS ${LIBRN_DIR}
|
||||||
|
NO_CMAKE_FIND_ROOT_PATH
|
||||||
|
)
|
||||||
|
# Use Reanimated JSC
|
||||||
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()
|
||||||
|
|
||||||
@ -95,52 +115,16 @@ find_library(
|
|||||||
NO_CMAKE_FIND_ROOT_PATH
|
NO_CMAKE_FIND_ROOT_PATH
|
||||||
)
|
)
|
||||||
|
|
||||||
find_library(
|
|
||||||
REACT_NATIVE_UTILS_LIB
|
|
||||||
reactnativeutilsjni
|
|
||||||
PATHS ${LIBRN_DIR}
|
|
||||||
NO_CMAKE_FIND_ROOT_PATH
|
|
||||||
)
|
|
||||||
|
|
||||||
find_library(
|
|
||||||
HERMES_LIB
|
|
||||||
hermes
|
|
||||||
PATHS ${LIBHERMES_DIR}
|
|
||||||
NO_CMAKE_FIND_ROOT_PATH
|
|
||||||
)
|
|
||||||
find_library(
|
|
||||||
JSEXECUTOR_LIB
|
|
||||||
jscexecutor
|
|
||||||
PATHS ${LIBRN_DIR}
|
|
||||||
NO_CMAKE_FIND_ROOT_PATH
|
|
||||||
)
|
|
||||||
|
|
||||||
# linking
|
# linking
|
||||||
|
|
||||||
message(WARNING "VisionCamera linking: FOR_HERMES=${FOR_HERMES}")
|
message(WARNING "VisionCamera linking: FOR_HERMES=${FOR_HERMES}")
|
||||||
|
target_link_libraries(
|
||||||
if(${FOR_HERMES})
|
|
||||||
target_link_libraries(
|
|
||||||
${PACKAGE_NAME}
|
${PACKAGE_NAME}
|
||||||
${LOG_LIB}
|
${LOG_LIB}
|
||||||
${HERMES_LIB}
|
${JS_ENGINE_LIB} # <-- Hermes or JSC
|
||||||
${REANIMATED_LIB}
|
${REANIMATED_LIB}
|
||||||
${REACT_NATIVE_JNI_LIB}
|
${REACT_NATIVE_JNI_LIB}
|
||||||
${REACT_NATIVE_UTILS_LIB}
|
|
||||||
${FBJNI_LIB}
|
${FBJNI_LIB}
|
||||||
${FOLLY_JSON_LIB}
|
${FOLLY_JSON_LIB}
|
||||||
android
|
android
|
||||||
)
|
)
|
||||||
else()
|
|
||||||
target_link_libraries(
|
|
||||||
${PACKAGE_NAME}
|
|
||||||
${LOG_LIB}
|
|
||||||
${JSEXECUTOR_LIB}
|
|
||||||
${REANIMATED_LIB}
|
|
||||||
${REACT_NATIVE_JNI_LIB}
|
|
||||||
${REACT_NATIVE_UTILS_LIB}
|
|
||||||
${FBJNI_LIB}
|
|
||||||
${FOLLY_JSON_LIB}
|
|
||||||
android
|
|
||||||
)
|
|
||||||
endif()
|
|
Loading…
Reference in New Issue
Block a user