cmake: restrict GGML_CPU_ALL_VARIANTS to supported architectures

The previous logic for enabling GGML_CPU_ALL_VARIANTS used a blacklist to exclude ARM processors. This caused builds to fail on other architectures not in the blacklist and not compatible with the option, such as loongarch64.

This changes the condition to a whitelist, only enabling GGML_CPU_ALL_VARIANTS for x86 and PowerPC architectures.

Signed-off-by: Zhou Qiankang <wszqkzqk@qq.com>
This commit is contained in:
Zhou Qiankang 2025-10-22 19:28:20 +08:00
parent d515aed6c3
commit 0ebea159cb
No known key found for this signature in database
GPG Key ID: F0647F18A79089C9
1 changed files with 1 additions and 1 deletions

View File

@ -28,7 +28,7 @@ set(GGML_CUDA_FA ON)
set(GGML_CUDA_COMPRESSION_MODE default) set(GGML_CUDA_COMPRESSION_MODE default)
if((CMAKE_OSX_ARCHITECTURES AND NOT CMAKE_OSX_ARCHITECTURES MATCHES "arm64") if((CMAKE_OSX_ARCHITECTURES AND NOT CMAKE_OSX_ARCHITECTURES MATCHES "arm64")
OR (NOT CMAKE_OSX_ARCHITECTURES AND NOT CMAKE_SYSTEM_PROCESSOR MATCHES "arm|aarch64|ARM64|ARMv[0-9]+")) OR (NOT CMAKE_OSX_ARCHITECTURES AND CMAKE_SYSTEM_PROCESSOR MATCHES "(?i)x86_64|amd64|i[3-6]86|powerpc|ppc64"))
set(GGML_CPU_ALL_VARIANTS ON) set(GGML_CPU_ALL_VARIANTS ON)
endif() endif()