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 @@ -51,7 +51,14 @@ endif() string(TOLOWER ${CMAKE_HOST_SYSTEM_NAME} CMAKE_HOST_SYSTEM_NAME_LOWER) -set(AR $ENV{ANDROID_HOME}/ndk/${NDK_VERSION}/toolchains/llvm/prebuilt/${CMAKE_HOST_SYSTEM_NAME_LOWER}-x86_64/bin/${Rust_CARGO_TARGET}-ar) +set(_toolchain_path + "$ENV{ANDROID_HOME}/ndk/${NDK_VERSION}/toolchains/llvm/prebuilt/${CMAKE_HOST_SYSTEM_NAME_LOWER}-x86_64/bin" +) +if(EXISTS "${_toolchain_path}/${Rust_CARGO_TARGET}-ar") + set(AR "${_toolchain_path}/${Rust_CARGO_TARGET}-ar") +else() + set(AR "${_toolchain_path}/llvm-ar") +endif() FetchContent_Declare( Corrosion