From 7cdc280ee0c1ffb391149cfbf2bded89f755bf77 Mon Sep 17 00:00:00 2001 From: zhifu gao Date: Sat, 20 Jun 2026 14:41:32 +0800 Subject: [PATCH] build: define NOMINMAX/_USE_MATH_DEFINES for MSVC (Windows portability) --- runtime/llama.cpp/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runtime/llama.cpp/CMakeLists.txt b/runtime/llama.cpp/CMakeLists.txt index ca19c1996..64ebad851 100644 --- a/runtime/llama.cpp/CMakeLists.txt +++ b/runtime/llama.cpp/CMakeLists.txt @@ -14,6 +14,9 @@ project(funasr-llamacpp CXX C) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) +if(MSVC) + add_compile_definitions(NOMINMAX _USE_MATH_DEFINES) # min/max macros + M_PI on MSVC +endif() set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE) # static deps -> self-contained binaries set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)