diff --git a/ggml/src/ggml-amx/CMakeLists.txt b/ggml/src/ggml-amx/CMakeLists.txt index 538220294..d6676f3f6 100644 --- a/ggml/src/ggml-amx/CMakeLists.txt +++ b/ggml/src/ggml-amx/CMakeLists.txt @@ -1,4 +1,7 @@ -if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 11.0) +if (CMAKE_OSX_ARCHITECTURES STREQUAL "x86_64" OR CMAKE_GENERATOR_PLATFORM_LWR MATCHES "^(x86_64|i686|amd64|x64|win32)$" OR + (NOT CMAKE_OSX_ARCHITECTURES AND NOT CMAKE_GENERATOR_PLATFORM_LWR AND + CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|i686|AMD64)$") AND + CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 11.0) message(STATUS "Using AMX") file(GLOB GGML_HEADERS_AMX "*.h") @@ -100,5 +103,5 @@ if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 11.0) target_compile_options(ggml-amx PRIVATE ${ARCH_FLAGS}) else() set(GGML_AMX OFF PARENT_SCOPE) - message(WARNING "AMX requires gcc version > 11.0. Turning off GGML_AMX.") + message(WARNING "AMX requires x86 and gcc version > 11.0. Turning off GGML_AMX.") endif()