more clever way to exclude libm if needed

check GGML_SYCL and ONEAPI_ROOT state rather than generator name.
This commit is contained in:
蕭澧邦 2024-10-22 05:23:45 +08:00 committed by GitHub
parent 89c533af18
commit d3b183f743
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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()