From 2aa5e1c71026699e9057cd6c0398f0fe14840711 Mon Sep 17 00:00:00 2001 From: Konstantinos Margaritis Date: Wed, 20 Dec 2023 15:15:38 +0000 Subject: [PATCH] fix arch=native on arm+clang --- cmake/archdetect.cmake | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/cmake/archdetect.cmake b/cmake/archdetect.cmake index 494269c2..2d64e5cf 100644 --- a/cmake/archdetect.cmake +++ b/cmake/archdetect.cmake @@ -68,8 +68,23 @@ if (USE_CPU_NATIVE) endif() else() if (SIMDE_BACKEND) - set(GNUCC_ARCH native) - set(TUNE_FLAG native) + if (CMAKE_COMPILER_IS_CLANG) + if(ARCH_AARCH64) + if (CMAKE_C_COMPILER_VERSION VERSION_LESS "15.0") + set(GNUCC_ARCH native) + set(TUNE_FLAG native) + else() + set(GNUCC_ARCH armv8-a) + set(TUNE_FLAG generic) + endif() + else() + set(GNUCC_ARCH native) + set(TUNE_FLAG native) + endif() + else() + set(GNUCC_ARCH native) + set(TUNE_FLAG native) + endif() elseif (ARCH_IA32 OR ARCH_X86_64) set(GNUCC_ARCH native) set(TUNE_FLAG generic)