[cmake] fix aarch64 neon detection

patch by @whitpa posted in #11997
This commit is contained in:
akallabeth
2025-11-17 08:28:27 +01:00
parent 193f76e7e5
commit f137b5eb9c

View File

@@ -20,7 +20,7 @@ macro(set_simd_source_file_properties INTRINSIC_TYPE)
set(SSE_X86_LIST "i686;x86")
set(SSE_LIST "x86_64;ia64;x64;amd64;ia64;em64t;${SSE_X86_LIST}")
set(NEON_LIST "arm;armv7;armv8b;armv8l")
set(NEON_LIST "arm;armv7;armv8b;armv8l;aarch64")
set(SUPPORTED_INTRINSICS_LIST "neon;sse2;sse3;ssse3;sse4.1;sse4.2;avx2")
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" SYSTEM_PROCESSOR)
@@ -85,7 +85,11 @@ macro(set_simd_source_file_properties INTRINSIC_TYPE)
if(MSVC)
set(SIMD_LINK_ARG "/arch:VFPv4")
elseif("${CMAKE_C_COMPILER_ID}" IN_LIST GCC_CLANG_NAMES)
set(SIMD_LINK_ARG "-mfpu=neon")
if("${SYSTEM_PROCESSOR}" STREQUAL "aarch64")
set(SIMD_LINK_ARG "ignore")
else()
set(SIMD_LINK_ARG "-mfpu=neon")
endif()
else()
message(WARNING "[SIMD] Unsupported compiler ${CMAKE_C_COMPILER_ID}, ignoring")
endif()