diff --git a/packages/komodo_defi_framework/android/app/src/main/cpp/CMakeLists.txt b/packages/komodo_defi_framework/android/app/src/main/cpp/CMakeLists.txt deleted file mode 100644 index 6883c49..0000000 --- a/packages/komodo_defi_framework/android/app/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,27 +0,0 @@ -cmake_minimum_required(VERSION 3.15) - -# Project-level configuration. -set(PROJECT_NAME "komodo_defi_framework") -project(${PROJECT_NAME} LANGUAGES CXX) - -find_library(log-lib log) -find_package(ZLIB) - -set(IMPORT_DIR ${CMAKE_SOURCE_DIR}/libs) - -# Shared library -set(PLUGIN_NAME "${PROJECT_NAME}_plugin") - -# Invoke the build for native code shared with the other target platforms. -# This can be changed to accommodate different builds. -add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/../../../../../src" "${CMAKE_CURRENT_BINARY_DIR}/shared") - -set(komodo_defi_framework_bundled_libraries - - # Defined in ../src/CMakeLists.txt. - # This can be changed to accommodate different builds. - $ - ${IMPORT_DIR}/${ANDROID_ABI}/libmm2.a - PARENT_SCOPE -) - diff --git a/packages/komodo_defi_framework/android/build.gradle b/packages/komodo_defi_framework/android/build.gradle index 727de2e..f97b437 100644 --- a/packages/komodo_defi_framework/android/build.gradle +++ b/packages/komodo_defi_framework/android/build.gradle @@ -53,19 +53,6 @@ android { // the plugin to fail to compile for some customers of the plugin. // version "3.10.2" } - - // Link - cmake { - path = "app/src/main/cpp/CMakeLists.txt" - - // The default CMake version for the Android Gradle Plugin is 3.10.2. - // https://developer.android.com/studio/projects/install-ndk#vanilla_cmake - // - // The Flutter tooling requires that developers have CMake 3.10 or later - // installed. You should not increase this version, as doing so will cause - // the plugin to fail to compile for some customers of the plugin. - // version "3.10.2" - } } compileOptions { diff --git a/packages/komodo_defi_framework/app_build/build_config.json b/packages/komodo_defi_framework/app_build/build_config.json index 425f965..2c09f9a 100644 --- a/packages/komodo_defi_framework/app_build/build_config.json +++ b/packages/komodo_defi_framework/app_build/build_config.json @@ -9,7 +9,7 @@ ], "platforms": { "web": { - "matching_pattern": "^kdf_[a-f0-9]+-wasm\\.zip$", + "matching_pattern": "wasm", "valid_zip_sha256_checksums": [ "f82e330a8d9bc1c2011604648233922cf216a732858c5a6a935ad77a286b1993" ], @@ -62,7 +62,7 @@ "coins": { "fetch_at_build_enabled": true, "update_commit_on_build": true, - "bundled_coins_repo_commit": "eae824b3502f9da19cce891f93e8c2f98fbf534f", + "bundled_coins_repo_commit": "8a37a6cdb8f4f334f305899006b31415e3a49bf1", "coins_repo_api_url": "https://api.github.com/repos/KomodoPlatform/coins", "coins_repo_content_url": "https://komodoplatform.github.io/coins", "coins_repo_branch": "master", diff --git a/packages/komodo_defi_framework/src/CMakeLists.txt b/packages/komodo_defi_framework/src/CMakeLists.txt index 33da89f..5455b97 100644 --- a/packages/komodo_defi_framework/src/CMakeLists.txt +++ b/packages/komodo_defi_framework/src/CMakeLists.txt @@ -15,3 +15,20 @@ set_target_properties(komodo_defi_framework PROPERTIES ) target_compile_definitions(komodo_defi_framework PUBLIC DART_SHARED_LIB) + +if(ANDROID) + set(KDFLIB_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../android/app/src/main/cpp/libs") + set(KDFLIB_PATH "${KDFLIB_DIR}/${ANDROID_ABI}/libmm2.a") + + find_library(KDFLIB_PATH mm2 PATHS "${CMAKE_SOURCE_DIR}/path/to/library/directory" NO_DEFAULT_PATH ) + + if(NOT EXISTS "${KDFLIB_PATH}") + message(FATAL_ERROR "Static library '${KDFLIB_PATH}' not found. Please ensure it is present.") + endif() + + target_link_libraries(komodo_defi_framework PRIVATE + "-Wl,--whole-archive" + "${KDFLIB_PATH}" + "-Wl,--no-whole-archive" + ) +endif()