From efc52dadc8323325136660c822a961d724216704 Mon Sep 17 00:00:00 2001 From: Piotr Wilkin Date: Tue, 10 Feb 2026 18:17:11 +0100 Subject: [PATCH] Add compilation guard to fix Windows compilation errors --- tools/parser/CMakeLists.txt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tools/parser/CMakeLists.txt b/tools/parser/CMakeLists.txt index 73157b0a0e..55e0c63437 100644 --- a/tools/parser/CMakeLists.txt +++ b/tools/parser/CMakeLists.txt @@ -1,10 +1,13 @@ -set(TARGET llama-debug-template-parser) -add_executable(${TARGET} debug-template-parser.cpp) -target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT}) -target_compile_features(${TARGET} PRIVATE cxx_std_17) +if (NOT WIN32 OR NOT BUILD_SHARED_LIBS) + # this tool is disabled on Windows when building with shared libraries because it uses internal functions not exported with LLAMA_API + set(TARGET llama-debug-template-parser) + add_executable(${TARGET} debug-template-parser.cpp) + target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT}) + target_compile_features(${TARGET} PRIVATE cxx_std_17) -if(LLAMA_TOOLS_INSTALL) - install(TARGETS ${TARGET} RUNTIME) + if(LLAMA_TOOLS_INSTALL) + install(TARGETS ${TARGET} RUNTIME) + endif() endif() set(TARGET llama-template-analysis)