Skip to content

Commit 89c533a

Browse files
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.
1 parent f594bc8 commit 89c533a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ggml/src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1400,7 +1400,7 @@ list(APPEND GGML_EXTRA_LIBS_PRIVATE Threads::Threads)
14001400

14011401
find_library(MATH_LIBRARY m)
14021402
if (MATH_LIBRARY)
1403-
if (NOT WIN32 OR NOT GGML_SYCL)
1403+
if ((NOT WIN32 OR NOT GGML_SYCL) AND NOT CMAKE_GENERATOR MATCHES "Visual Studio*")
14041404
list(APPEND GGML_EXTRA_LIBS_PRIVATE m)
14051405
endif()
14061406
endif()

0 commit comments

Comments
 (0)