From 4d5232083f70d90220a288db7b3f7ab0d0d1b3ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ekstr=C3=B6m?= Date: Tue, 31 Mar 2026 17:10:34 +0300 Subject: [PATCH] chore(server): link winsock2 for non-MSVC windows (#1378) --- examples/server/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/server/CMakeLists.txt b/examples/server/CMakeLists.txt index 8f5beba..f2568d7 100644 --- a/examples/server/CMakeLists.txt +++ b/examples/server/CMakeLists.txt @@ -70,4 +70,10 @@ endif() install(TARGETS ${TARGET} RUNTIME) target_link_libraries(${TARGET} PRIVATE stable-diffusion ${CMAKE_THREAD_LIBS_INIT}) + +# due to httplib; it contains a pragma for MSVC, but other things need explicit flags +if(WIN32 AND NOT MSVC) + target_link_libraries(${TARGET} PRIVATE ws2_32) +endif() + target_compile_features(${TARGET} PUBLIC c_std_11 cxx_std_17) \ No newline at end of file