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 @@ -19,6 +19,7 @@ # Gradle automatically packages shared libraries with your APK. set(PACKAGE_NAME "comm_jni_module") +find_library(log-lib log) find_package(fbjni REQUIRED CONFIG) set(BUILD_TESTING OFF) @@ -103,7 +104,19 @@ file(GLOB SQLCIPHER "${_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") file(GLOB CRYPTO_NATIVE_CODE "../../cpp/CommonCpp/CryptoTools/*.cpp") @@ -111,7 +124,6 @@ file(GLOB DB_ENTITIES_NATIVE_CODE "../../cpp/CommonCpp/DatabaseManagers/entities/*.cpp") file(GLOB_RECURSE MODULE_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") add_library( # Sets the name of the library @@ -176,7 +188,6 @@ ../../cpp/CommonCpp/NativeModules/PersistentStorageUtilities/MessageOperationsUtilities ../../cpp/CommonCpp/NativeModules/PersistentStorageUtilities/MessageOperationsUtilities/MessageSpecs ../../cpp/CommonCpp/DatabaseManagers - ../../cpp/CommonCpp/Tools # native rust library ${native_rust_library_include_dir} @@ -190,8 +201,6 @@ -DSQLCIPHER_CRYPTO_OPENSSL ) -find_library(log-lib log) - target_link_libraries( ${PACKAGE_NAME} fbjni::fbjni @@ -203,6 +212,7 @@ openssl-crypto openssl-ssl comm::native_rust_library + comm-tools ) # add a dummy library which is required by CallInvokerHolderImpl.java diff --git a/native/cpp/CommonCpp/Tools/CMakeLists.txt b/native/cpp/CommonCpp/Tools/CMakeLists.txt --- a/native/cpp/CommonCpp/Tools/CMakeLists.txt +++ b/native/cpp/CommonCpp/Tools/CMakeLists.txt @@ -4,9 +4,6 @@ include(GNUInstallDirs) set(TOOLS_HDRS - "CommSecureStore.h" - "Logger.h" - "PlatformSpecificTools.h" "WorkerThread.h" ) @@ -15,6 +12,7 @@ ) add_library(comm-tools + STATIC ${TOOLS_HDRS} ${TOOLS_SRCS} )