From d9fa6abdfa5eb809fee37177928a76e07baff8fe Mon Sep 17 00:00:00 2001 From: rodrigomatta Date: Sun, 17 May 2026 13:52:18 -0300 Subject: [PATCH] Fix MSVC math library link --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 75763dc..f6d8a51 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,13 @@ if(S2_METAL AND NOT APPLE) message(FATAL_ERROR "S2_METAL is only supported on Apple platforms.") endif() +# MSVC provides math functions through the CRT and does not ship a separate +# libm. Some ggml CMake revisions still probe for "m" and can propagate +# MATH_LIBRARY-NOTFOUND into the generated Visual Studio linker inputs. +if(MSVC) + set(MATH_LIBRARY "" CACHE FILEPATH "MSVC does not require a separate math library." FORCE) +endif() + set(GGML_BUILD_TESTS OFF CACHE BOOL "" FORCE) set(GGML_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)