diff --git a/native/android/app/CMakeLists.txt b/native/android/app/CMakeLists.txt --- a/native/android/app/CMakeLists.txt +++ b/native/android/app/CMakeLists.txt @@ -88,6 +88,7 @@ endif () include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/folly-target.cmake) +include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/openssl-target.cmake) add_subdirectory(../../node_modules/olm ./build) @@ -154,9 +155,6 @@ ${_react_native_dir}/ReactCommon/callinvoker ${_react_native_dir}/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/ReactCommon - # OpenSSL - ${_third_party_dir}/openssl/openssl-${OPENSSL_VERSION}/build/${CMAKE_ANDROID_ARCH_ABI}/include - # SQLCipher amalgamation ${_node_modules_dir}/@commapp/sqlcipher-amalgamation/src @@ -194,34 +192,6 @@ find_library(log-lib log) -add_library( - # OpenSSL Crypto lib - openssl-crypto - STATIC - IMPORTED -) - -set_target_properties( - # OpenSSL Crypto lib - openssl-crypto - PROPERTIES IMPORTED_LOCATION - "${_third_party_dir}/openssl/openssl-${OPENSSL_VERSION}/build/${CMAKE_ANDROID_ARCH_ABI}/lib/libcrypto.a" -) - -add_library( - # OpenSSL SSL lib - openssl-ssl - STATIC - IMPORTED -) - -set_target_properties( - # OpenSSL SSL lib - openssl-ssl - PROPERTIES IMPORTED_LOCATION - "${_third_party_dir}/openssl/openssl-${OPENSSL_VERSION}/build/${CMAKE_ANDROID_ARCH_ABI}/lib/libssl.a" -) - target_link_libraries( ${PACKAGE_NAME} fbjni::fbjni diff --git a/native/android/app/cmake/openssl-target.cmake b/native/android/app/cmake/openssl-target.cmake new file mode 100644 --- /dev/null +++ b/native/android/app/cmake/openssl-target.cmake @@ -0,0 +1,30 @@ +set(OPENSSL_DIR "${_third_party_dir}/openssl/openssl-${OPENSSL_VERSION}") +SET(OPENSSL_BUILD_DIR "${OPENSSL_DIR}/build/${CMAKE_ANDROID_ARCH_ABI}") + +add_library( + # OpenSSL Crypto lib + openssl-crypto + STATIC + IMPORTED +) + +set_target_properties( + # OpenSSL Crypto lib + openssl-crypto + PROPERTIES IMPORTED_LOCATION "${OPENSSL_BUILD_DIR}/lib/libcrypto.a" + INTERFACE_INCLUDE_DIRECTORIES "${OPENSSL_BUILD_DIR}/include" +) + +add_library( + # OpenSSL SSL lib + openssl-ssl + STATIC + IMPORTED +) + +set_target_properties( + # OpenSSL SSL lib + openssl-ssl + PROPERTIES IMPORTED_LOCATION "${OPENSSL_BUILD_DIR}/lib/libssl.a" + INTERFACE_INCLUDE_DIRECTORIES "${OPENSSL_BUILD_DIR}/include" +)