From 5c8dd7124398e899e8efcd531accc223b4033be9 Mon Sep 17 00:00:00 2001 From: Bart Louwers Date: Tue, 3 Dec 2024 23:30:08 +0100 Subject: [PATCH] Use CMake 3.24.0+ for Android (#3065) --- platform/android/android.cmake | 8 ++++++++ platform/android/buildSrc/src/main/kotlin/Versions.kt | 4 ++-- test/android/app/build.gradle.kts | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/platform/android/android.cmake b/platform/android/android.cmake index 0f14d074f46..dd01b8f11e1 100644 --- a/platform/android/android.cmake +++ b/platform/android/android.cmake @@ -146,6 +146,14 @@ target_include_directories( ${PROJECT_SOURCE_DIR}/src ) +# this is needed because Android is not officially supported +# https://discourse.cmake.org/t/error-when-crosscompiling-with-whole-archive-target-link/9394 +# https://cmake.org/cmake/help/latest/release/3.24.html#generator-expressions +set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE +"-Wl,--whole-archive -Wl,--no-whole-archive" +) +set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE_SUPPORTED True) + find_package(curl CONFIG) target_link_libraries( diff --git a/platform/android/buildSrc/src/main/kotlin/Versions.kt b/platform/android/buildSrc/src/main/kotlin/Versions.kt index 16fd70fae6b..ba52910f87a 100644 --- a/platform/android/buildSrc/src/main/kotlin/Versions.kt +++ b/platform/android/buildSrc/src/main/kotlin/Versions.kt @@ -1,4 +1,4 @@ object Versions { - const val ndkVersion ="27.0.12077973" - const val cmakeVersion = "3.18.1+" + const val ndkVersion = "27.0.12077973" + const val cmakeVersion = "3.24.0+" } \ No newline at end of file diff --git a/test/android/app/build.gradle.kts b/test/android/app/build.gradle.kts index 59f06ff4bc1..8e4b40b4576 100644 --- a/test/android/app/build.gradle.kts +++ b/test/android/app/build.gradle.kts @@ -47,7 +47,7 @@ android { externalNativeBuild { cmake { - version = "3.18.1+" + version = "3.24.0+" path = file("../../../CMakeLists.txt") } }