cmake: exclude math library when generator is Visual Studio
Trying to build cpu only variant on Windows when oneAPI environment is active, it will failed by an linker error LNK1104. This commit solved the issue by excluding libm.lib target link also when cmake generator is any version of Visual Studio.
This commit is contained in:
parent
f594bc80ba
commit
89c533af18
1 changed files with 1 additions and 1 deletions
|
@ -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)
|
||||
if ((NOT WIN32 OR NOT GGML_SYCL) AND NOT CMAKE_GENERATOR MATCHES "Visual Studio*")
|
||||
list(APPEND GGML_EXTRA_LIBS_PRIVATE m)
|
||||
endif()
|
||||
endif()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue