build : link ws2_32 as PUBLIC on Windows

Signed-off-by: Adrien Gallouët <adrien@gallouet.fr>
This commit is contained in:
Adrien Gallouët 2026-02-16 12:39:36 +00:00
parent d5dfc33027
commit d1eddb7b4c
No known key found for this signature in database
2 changed files with 1 additions and 5 deletions

View File

@ -59,8 +59,4 @@ target_include_directories(${TARGET} PRIVATE ../mtmd)
target_include_directories(${TARGET} PRIVATE ${CMAKE_SOURCE_DIR}) target_include_directories(${TARGET} PRIVATE ${CMAKE_SOURCE_DIR})
target_link_libraries(${TARGET} PRIVATE server-context PUBLIC common cpp-httplib ${CMAKE_THREAD_LIBS_INIT}) target_link_libraries(${TARGET} PRIVATE server-context PUBLIC common cpp-httplib ${CMAKE_THREAD_LIBS_INIT})
if (WIN32)
TARGET_LINK_LIBRARIES(${TARGET} PRIVATE ws2_32)
endif()
target_compile_features(${TARGET} PRIVATE cxx_std_17) target_compile_features(${TARGET} PRIVATE cxx_std_17)

View File

@ -17,7 +17,7 @@ endif()
target_link_libraries(${TARGET} PRIVATE Threads::Threads) target_link_libraries(${TARGET} PRIVATE Threads::Threads)
if (WIN32 AND NOT MSVC) if (WIN32 AND NOT MSVC)
target_link_libraries(${TARGET} PRIVATE ws2_32) target_link_libraries(${TARGET} PUBLIC ws2_32)
endif() endif()
target_compile_features(${TARGET} PRIVATE cxx_std_17) target_compile_features(${TARGET} PRIVATE cxx_std_17)