diff --git a/ggml/src/ggml-cpu/CMakeLists.txt b/ggml/src/ggml-cpu/CMakeLists.txt index 7e53a57b7b0..0f09ca4eceb 100644 --- a/ggml/src/ggml-cpu/CMakeLists.txt +++ b/ggml/src/ggml-cpu/CMakeLists.txt @@ -302,7 +302,10 @@ function(ggml_add_cpu_backend_variant_impl tag_name) endif() if (GGML_BMI2) # MSVC does not define macro __BMI2__ - list(APPEND ARCH_DEFINITIONS __BMI2__ GGML_BMI2) + if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "amd64") + # BMI2 is only available on amd64 + list(APPEND ARCH_DEFINITIONS __BMI2__ GGML_BMI2) + endif() endif() else () if (GGML_NATIVE)