From d3b183f7431ca1d2d772ec62302913b98ad8131e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=95=AD=E6=BE=A7=E9=82=A6?= <45505768+shou692199@users.noreply.github.com> Date: Tue, 22 Oct 2024 05:23:45 +0800 Subject: [PATCH] more clever way to exclude libm if needed check GGML_SYCL and ONEAPI_ROOT state rather than generator name. --- ggml/src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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()