diff --git a/ggml/src/CMakeLists.txt b/ggml/src/CMakeLists.txt index b4b9dde91..0ed81193a 100644 --- a/ggml/src/CMakeLists.txt +++ b/ggml/src/CMakeLists.txt @@ -1400,7 +1400,7 @@ list(APPEND GGML_EXTRA_LIBS_PRIVATE Threads::Threads) find_library(MATH_LIBRARY m) if (MATH_LIBRARY) - if ((NOT WIN32 OR NOT GGML_SYCL) AND NOT CMAKE_GENERATOR MATCHES "Visual Studio*") + if (NOT WIN32 OR NOT (GGML_SYCL OR DEFINED ENV{ONEAPI_ROOT})) list(APPEND GGML_EXTRA_LIBS_PRIVATE m) endif() endif()