Changeset View
Changeset View
Standalone View
Standalone View
native/android/app/CMakeLists.txt
Show All 13 Lines | |||||
cmake_minimum_required(VERSION 3.18) | cmake_minimum_required(VERSION 3.18) | ||||
# Creates and names a library, sets it as either STATIC | # Creates and names a library, sets it as either STATIC | ||||
# or SHARED, and provides the relative paths to its source code. | # or SHARED, and provides the relative paths to its source code. | ||||
# You can define multiple libraries, and CMake builds them for you. | # You can define multiple libraries, and CMake builds them for you. | ||||
# Gradle automatically packages shared libraries with your APK. | # Gradle automatically packages shared libraries with your APK. | ||||
set(PACKAGE_NAME "comm_jni_module") | set(PACKAGE_NAME "comm_jni_module") | ||||
find_library(log-lib log) | |||||
find_package(fbjni REQUIRED CONFIG) | find_package(fbjni REQUIRED CONFIG) | ||||
set(BUILD_TESTING OFF) | set(BUILD_TESTING OFF) | ||||
set(HAVE_SYMBOLIZE OFF) | set(HAVE_SYMBOLIZE OFF) | ||||
set(WITH_GTEST OFF CACHE BOOL "Use googletest" FORCE) | set(WITH_GTEST OFF CACHE BOOL "Use googletest" FORCE) | ||||
set(WITH_GFLAGS OFF CACHE BOOL "Use gflags" FORCE) | set(WITH_GFLAGS OFF CACHE BOOL "Use gflags" FORCE) | ||||
# General | # General | ||||
▲ Show 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | |||||
add_subdirectory(../../cpp/CommonCpp/ | add_subdirectory(../../cpp/CommonCpp/ | ||||
${CMAKE_CURRENT_BINARY_DIR}/build/CommonCpp | ${CMAKE_CURRENT_BINARY_DIR}/build/CommonCpp | ||||
EXCLUDE_FROM_ALL | EXCLUDE_FROM_ALL | ||||
) | ) | ||||
file(GLOB SQLCIPHER | file(GLOB SQLCIPHER | ||||
"${_node_modules_dir}/@commapp/sqlcipher-amalgamation/src/*.c" | "${_node_modules_dir}/@commapp/sqlcipher-amalgamation/src/*.c" | ||||
) | ) | ||||
file(GLOB ANDROID_NATIVE_CODE "./src/cpp/*.cpp") | |||||
# Add files which aren't a part of comm-tools | |||||
list(APPEND ANDROID_NATIVE_CODE | |||||
"./src/cpp/CommSecureStore.cpp" | |||||
"./src/cpp/DatabaseInitializerJNIHelper.cpp" | |||||
"./src/cpp/GlobalDBSingleton.cpp" | |||||
"./src/cpp/Logger.cpp" | |||||
"./src/cpp/MessageOperationsUtilitiesJNIHelper.cpp" | |||||
"./src/cpp/PlatformSpecificTools.cpp" | |||||
"./src/cpp/TerminateApp.cpp" | |||||
"./src/cpp/ThreadOperationsJNIHelper.cpp" | |||||
"./src/cpp/jsiInstaller.cpp" | |||||
) | |||||
set(GENERATED_NATIVE_CODE "../../cpp/CommonCpp/_generated/commJSI-generated.cpp") | set(GENERATED_NATIVE_CODE "../../cpp/CommonCpp/_generated/commJSI-generated.cpp") | ||||
file(GLOB CRYPTO_NATIVE_CODE "../../cpp/CommonCpp/CryptoTools/*.cpp") | file(GLOB CRYPTO_NATIVE_CODE "../../cpp/CommonCpp/CryptoTools/*.cpp") | ||||
file(GLOB DB_NATIVE_CODE "../../cpp/CommonCpp/DatabaseManagers/*.cpp") | file(GLOB DB_NATIVE_CODE "../../cpp/CommonCpp/DatabaseManagers/*.cpp") | ||||
file(GLOB DB_ENTITIES_NATIVE_CODE "../../cpp/CommonCpp/DatabaseManagers/entities/*.cpp") | file(GLOB DB_ENTITIES_NATIVE_CODE "../../cpp/CommonCpp/DatabaseManagers/entities/*.cpp") | ||||
file(GLOB_RECURSE MODULE_NATIVE_CODE "../../cpp/CommonCpp/NativeModules/**/*.cpp") | file(GLOB_RECURSE MODULE_NATIVE_CODE "../../cpp/CommonCpp/NativeModules/**/*.cpp") | ||||
file(GLOB MODULE_ROOT_NATIVE_CODE "../../cpp/CommonCpp/NativeModules/*.cpp") | file(GLOB MODULE_ROOT_NATIVE_CODE "../../cpp/CommonCpp/NativeModules/*.cpp") | ||||
file(GLOB TOOLS_NATIVE_CODE "../../cpp/CommonCpp/Tools/*.cpp") | |||||
file(GLOB NOTIFICATIONS_NATIVE_CODE "../../cpp/CommonCpp/Notifications/**/*.cpp") | file(GLOB NOTIFICATIONS_NATIVE_CODE "../../cpp/CommonCpp/Notifications/**/*.cpp") | ||||
add_library( | add_library( | ||||
# Sets the name of the library | # Sets the name of the library | ||||
${PACKAGE_NAME} | ${PACKAGE_NAME} | ||||
# Sets the library as a shared library | # Sets the library as a shared library | ||||
SHARED | SHARED | ||||
▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | target_include_directories( | ||||
../../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/Notifications | ../../cpp/CommonCpp/Notifications | ||||
../../cpp/CommonCpp/Notifications/BackgroundDataStorage | ../../cpp/CommonCpp/Notifications/BackgroundDataStorage | ||||
# native rust library | # native rust library | ||||
${native_rust_library_include_dir} | ${native_rust_library_include_dir} | ||||
) | ) | ||||
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 | ||||
) | ) | ||||
find_library(log-lib log) | |||||
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 | ||||
openssl-crypto | openssl-crypto | ||||
openssl-ssl | openssl-ssl | ||||
comm::native_rust_library | comm::native_rust_library | ||||
comm-tools | |||||
) | ) | ||||
# 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 | ||||
) | ) |