Changeset View
Changeset View
Standalone View
Standalone View
native/android/app/CMakeLists.txt
Show First 20 Lines • Show All 82 Lines • ▼ Show 20 Lines | |||||
file(GLOB LIBRN_DIR "${REACT_NATIVE_SO_DIR}/${ANDROID_ABI}") | file(GLOB LIBRN_DIR "${REACT_NATIVE_SO_DIR}/${ANDROID_ABI}") | ||||
if (NOT LIBRN_DIR) | if (NOT LIBRN_DIR) | ||||
# If /${ANDROID_ABI} dir not found, then ${REACT_NATIVE_SO_DIR} is probably: | # If /${ANDROID_ABI} dir not found, then ${REACT_NATIVE_SO_DIR} is probably: | ||||
# ReactAndroid/build/react-ndk/exported | # ReactAndroid/build/react-ndk/exported | ||||
file(GLOB LIBRN_DIR "${REACT_NATIVE_SO_DIR}") | file(GLOB LIBRN_DIR "${REACT_NATIVE_SO_DIR}") | ||||
endif () | endif () | ||||
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/folly-target.cmake) | include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/folly-target.cmake) | ||||
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/openssl-target.cmake) | |||||
add_subdirectory(../../node_modules/olm ./build) | add_subdirectory(../../node_modules/olm ./build) | ||||
set(_node_modules_dir ${CMAKE_CURRENT_SOURCE_DIR}/../../node_modules) | set(_node_modules_dir ${CMAKE_CURRENT_SOURCE_DIR}/../../node_modules) | ||||
set(_react_native_dir ${_node_modules_dir}/react-native) | set(_react_native_dir ${_node_modules_dir}/react-native) | ||||
add_subdirectory(../../cpp/CommonCpp/ | add_subdirectory(../../cpp/CommonCpp/ | ||||
${CMAKE_CURRENT_BINARY_DIR}/build/CommonCpp | ${CMAKE_CURRENT_BINARY_DIR}/build/CommonCpp | ||||
▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | target_include_directories( | ||||
# React Native | # React Native | ||||
${_react_native_dir}/React | ${_react_native_dir}/React | ||||
${_react_native_dir}/React/Base | ${_react_native_dir}/React/Base | ||||
${_react_native_dir}/ReactCommon | ${_react_native_dir}/ReactCommon | ||||
${_react_native_dir}/ReactCommon/jsi | ${_react_native_dir}/ReactCommon/jsi | ||||
${_react_native_dir}/ReactCommon/callinvoker | ${_react_native_dir}/ReactCommon/callinvoker | ||||
${_react_native_dir}/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/ReactCommon | ${_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 | # SQLCipher amalgamation | ||||
${_node_modules_dir}/@commapp/sqlcipher-amalgamation/src | ${_node_modules_dir}/@commapp/sqlcipher-amalgamation/src | ||||
# SQLite ORM | # SQLite ORM | ||||
../../cpp/third-party/sqlite_orm | ../../cpp/third-party/sqlite_orm | ||||
# symlinked React Native headers | # symlinked React Native headers | ||||
../headers | ../headers | ||||
Show All 21 Lines | add_definitions( | ||||
-DSQLITE_THREADSAFE=0 | -DSQLITE_THREADSAFE=0 | ||||
-DSQLITE_HAS_CODEC | -DSQLITE_HAS_CODEC | ||||
-DSQLITE_TEMP_STORE=2 | -DSQLITE_TEMP_STORE=2 | ||||
-DSQLCIPHER_CRYPTO_OPENSSL | -DSQLCIPHER_CRYPTO_OPENSSL | ||||
) | ) | ||||
find_library(log-lib log) | 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( | target_link_libraries( | ||||
${PACKAGE_NAME} | ${PACKAGE_NAME} | ||||
fbjni::fbjni | fbjni::fbjni | ||||
android | android | ||||
${log-lib} | ${log-lib} | ||||
Folly::folly | Folly::folly | ||||
glog::glog | glog::glog | ||||
olm | olm | ||||
Show All 13 Lines |