From 6335933a5b2dfdac8541d3e748201d1bc1e3ec50 Mon Sep 17 00:00:00 2001 From: Kreijstal Date: Sun, 10 Dec 2023 18:47:52 +0100 Subject: [PATCH] cmake : Fix bug in httplib.h for mingw (#1615) Fix bug in httlib.h for mingw, please see https://github.com/yhirose/cpp-httplib/issues/1669 --- examples/server/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/server/CMakeLists.txt b/examples/server/CMakeLists.txt index 9b1e6655..f5302276 100644 --- a/examples/server/CMakeLists.txt +++ b/examples/server/CMakeLists.txt @@ -4,3 +4,9 @@ add_executable(${TARGET} server.cpp httplib.h json.hpp) include(DefaultTargetOptions) target_link_libraries(${TARGET} PRIVATE common whisper ${CMAKE_THREAD_LIBS_INIT}) + +# Check if the compiler is MinGW +if(MINGW) + # Link the necessary libraries for SSL and Winsock + target_link_libraries(${TARGET} PRIVATE -lcrypt32 -lssl -lcrypto -lws2_32) +endif()