From 2c122a4401e9e25049acf3ce56c53e17cc04455a Mon Sep 17 00:00:00 2001 From: DH Date: Fri, 28 Feb 2025 20:56:23 +0300 Subject: [PATCH] llvm: disable extra targets for android explicitly specify native target, llvm determines wrongly if cross compiler used --- 3rdparty/llvm/CMakeLists.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/3rdparty/llvm/CMakeLists.txt b/3rdparty/llvm/CMakeLists.txt index b3d33da3c8..8723728f4a 100644 --- a/3rdparty/llvm/CMakeLists.txt +++ b/3rdparty/llvm/CMakeLists.txt @@ -5,7 +5,17 @@ if(WITH_LLVM) if(BUILD_LLVM) message(STATUS "LLVM will be built from the submodule.") - set(LLVM_TARGETS_TO_BUILD "AArch64;X86" CACHE STRING "Semicolon-separated list of targets to build, or \"all\".") + if (ANDROID) + if (COMPILER_ARM) + set(LLVM_TARGETS_TO_BUILD "AArch64" CACHE STRING "Semicolon-separated list of targets to build, or \"all\".") + set(LLVM_TARGET_ARCH "${CMAKE_SYSTEM_PROCESSOR}-none-linux-android${ANDROID_NATIVE_API_LEVEL}" CACHE STRING "") + else() + set(LLVM_TARGETS_TO_BUILD "X86" CACHE STRING "Semicolon-separated list of targets to build, or \"all\".") + endif() + else() + set(LLVM_TARGETS_TO_BUILD "AArch64;X86" CACHE STRING "Semicolon-separated list of targets to build, or \"all\".") + endif() + option(LLVM_BUILD_RUNTIME "Build the LLVM runtime libraries." OFF) option(LLVM_BUILD_TOOLS "Build the LLVM tools. If OFF, just generate build targets." OFF) option(LLVM_INCLUDE_BENCHMARKS "Generate benchmark targets. If OFF, benchmarks can't be built." OFF)