fix: turn off math march if not auto detected (#220)

This commit is contained in:
rayx 2026-03-12 16:12:28 +08:00 committed by GitHub
parent c05974cab1
commit b6a4eaddc2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -18,7 +18,7 @@ if(UNIX AND NOT APPLE)
list(APPEND EXTRA_LIBS ${LIB_RT})
endif()
if(NOT ANDROID)
if(NOT ANDROID AND AUTO_DETECT_ARCH)
if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|i686|i386|x64")
setup_compiler_march_for_x86(MATH_MARCH_FLAG_SSE MATH_MARCH_FLAG_AVX2 MATH_MARCH_FLAG_AVX512)
message(STATUS "best compiler march, sse: " ${MATH_MARCH_FLAG_SSE} ", avx2: " ${MATH_MARCH_FLAG_AVX2} ", avx512: " ${MATH_MARCH_FLAG_AVX512})