Changeset View
Changeset View
Standalone View
Standalone View
native/android/app/CMakeLists.txt
Show First 20 Lines • Show All 74 Lines • ▼ Show 20 Lines | if( | ||||
CMAKE_ANDROID_ARCH_ABI STREQUAL arm64-v8a OR | CMAKE_ANDROID_ARCH_ABI STREQUAL arm64-v8a OR | ||||
CMAKE_ANDROID_ARCH_ABI STREQUAL armeabi-v7a | CMAKE_ANDROID_ARCH_ABI STREQUAL armeabi-v7a | ||||
) | ) | ||||
set(HAVE_EXECINFO_H OFF CACHE BOOL "Whether platform has execinfo.h") | set(HAVE_EXECINFO_H OFF CACHE BOOL "Whether platform has execinfo.h") | ||||
endif() | endif() | ||||
add_subdirectory(${_third_party_dir}/glog/glog-${GLOG_VERSION}/) | add_subdirectory(${_third_party_dir}/glog/glog-${GLOG_VERSION}/) | ||||
file(GLOB LIBRN_DIR "${REACT_NATIVE_SO_DIR}/${ANDROID_ABI}") | |||||
if (NOT LIBRN_DIR) | |||||
# If /${ANDROID_ABI} dir not found, then ${REACT_NATIVE_SO_DIR} is probably: | |||||
# ReactAndroid/build/react-ndk/exported | |||||
file(GLOB LIBRN_DIR "${REACT_NATIVE_SO_DIR}") | |||||
endif () | |||||
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/folly-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) | ||||
file(GLOB SQLCIPHER | file(GLOB SQLCIPHER | ||||
"${_node_modules_dir}/@commapp/sqlcipher-amalgamation/src/*.c" | "${_node_modules_dir}/@commapp/sqlcipher-amalgamation/src/*.c" | ||||
) | ) | ||||
▲ Show 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | target_include_directories( | ||||
${_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 | ||||
# external libs | |||||
${_third_party_dir}/folly | |||||
${_third_party_dir}/boost/boost_${BOOST_VERSION} | |||||
${_third_party_dir}/double-conversion | |||||
# comm android specific code | # comm android specific code | ||||
./src/cpp | ./src/cpp | ||||
# comm native mutual code | # comm native mutual code | ||||
../../cpp/CommonCpp/ | ../../cpp/CommonCpp/ | ||||
../../cpp/CommonCpp/NativeModules | ../../cpp/CommonCpp/NativeModules | ||||
../../cpp/CommonCpp/NativeModules/InternalModules | ../../cpp/CommonCpp/NativeModules/InternalModules | ||||
../../cpp/CommonCpp/NativeModules/PersistentStorageUtilities | ../../cpp/CommonCpp/NativeModules/PersistentStorageUtilities | ||||
../../cpp/CommonCpp/NativeModules/PersistentStorageUtilities/ThreadOperationsUtilities | ../../cpp/CommonCpp/NativeModules/PersistentStorageUtilities/ThreadOperationsUtilities | ||||
../../cpp/CommonCpp/NativeModules/PersistentStorageUtilities/MessageOperationsUtilities | ../../cpp/CommonCpp/NativeModules/PersistentStorageUtilities/MessageOperationsUtilities | ||||
../../cpp/CommonCpp/NativeModules/PersistentStorageUtilities/MessageOperationsUtilities/MessageSpecs | ../../cpp/CommonCpp/NativeModules/PersistentStorageUtilities/MessageOperationsUtilities/MessageSpecs | ||||
../../cpp/CommonCpp/DatabaseManagers | ../../cpp/CommonCpp/DatabaseManagers | ||||
../../cpp/CommonCpp/Tools | ../../cpp/CommonCpp/Tools | ||||
# native rust library | # native rust library | ||||
${native_rust_library_include_dir} | ${native_rust_library_include_dir} | ||||
) | ) | ||||
file(GLOB LIBRN_DIR "${REACT_NATIVE_SO_DIR}/${ANDROID_ABI}") | |||||
if (NOT LIBRN_DIR) | |||||
# If /${ANDROID_ABI} dir not found, then ${REACT_NATIVE_SO_DIR} is probably: | |||||
# ReactAndroid/build/react-ndk/exported | |||||
file(GLOB LIBRN_DIR "${REACT_NATIVE_SO_DIR}") | |||||
endif () | |||||
find_library( | |||||
folly-lib | |||||
folly_runtime | |||||
PATHS ${LIBRN_DIR} | |||||
NO_CMAKE_FIND_ROOT_PATH | |||||
) | |||||
target_compile_options( | |||||
${PACKAGE_NAME} | |||||
PRIVATE -DFOLLY_NO_CONFIG=1 | |||||
-DFOLLY_HAVE_CLOCK_GETTIME=1 | |||||
-DFOLLY_HAVE_MEMRCHR=1 | |||||
-DFOLLY_USE_LIBCPP=1 | |||||
-DFOLLY_MOBILE=1 | |||||
) | |||||
add_definitions( | add_definitions( | ||||
# SQLCipher | # SQLCipher | ||||
-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 | ||||
) | ) | ||||
Show All 27 Lines | set_target_properties( | ||||
"${_third_party_dir}/openssl/openssl-${OPENSSL_VERSION}/build/${CMAKE_ANDROID_ARCH_ABI}/lib/libssl.a" | "${_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-lib} | Folly::folly | ||||
glog::glog | glog::glog | ||||
olm | olm | ||||
openssl-crypto | openssl-crypto | ||||
openssl-ssl | openssl-ssl | ||||
comm::native_rust_library | comm::native_rust_library | ||||
) | ) | ||||
# add a dummy library which is required by CallInvokerHolderImpl.java | # add a dummy library which is required by CallInvokerHolderImpl.java | ||||
add_library( | add_library( | ||||
turbomodulejsijni | turbomodulejsijni | ||||
# Sets the library as a shared library. | # Sets the library as a shared library. | ||||
SHARED | SHARED | ||||
# Provides a relative path to your source file(s). | # Provides a relative path to your source file(s). | ||||
./src/cpp/dummy.cpp | ./src/cpp/dummy.cpp | ||||
) | ) |