From 8386fc615246d41b068d9691408095a94ef8328b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ekstr=C3=B6m?= Date: Mon, 30 Mar 2026 23:24:19 +0300 Subject: [PATCH] examples/server/CMakeLists: link winsock2 for non-MSVC windows httplib handles this for MSVC by a pragma in the header, but this is not something understood by other compilers. --- examples/server/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/server/CMakeLists.txt b/examples/server/CMakeLists.txt index 8f5beba81..f2568d72e 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