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
This commit is contained in:
Kreijstal 2023-12-10 18:47:52 +01:00 committed by GitHub
parent 885b5563d0
commit 6335933a5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,3 +4,9 @@ add_executable(${TARGET} server.cpp httplib.h json.hpp)
include(DefaultTargetOptions) include(DefaultTargetOptions)
target_link_libraries(${TARGET} PRIVATE common whisper ${CMAKE_THREAD_LIBS_INIT}) 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()