diff --git a/CMakeLists.txt b/CMakeLists.txt index 44b6e18..19c024f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -322,7 +322,7 @@ endif() # Winsock. if(WIN32) set(CMAKE_EXTRA_INCLUDE_FILES winsock2.h ws2tcpip.h) - set(CMAKE_REQUIRED_LIBRARIES ws2_32.lib) + set(CMAKE_REQUIRED_LIBRARIES ws2_32.lib advapi32.lib shell32.lib) set(CMAKE_REQUIRED_DEFINITIONS -FIwinsock2.h -FIws2tcpip.h) endif() if (SOLARIS) diff --git a/cmake/AddEventLibrary.cmake b/cmake/AddEventLibrary.cmake index 411ca9d..869735e 100644 --- a/cmake/AddEventLibrary.cmake +++ b/cmake/AddEventLibrary.cmake @@ -73,6 +73,8 @@ macro(add_event_library LIB_NAME) list(APPEND ADD_EVENT_LIBRARY_TARGETS "${LIB_NAME}_static") set(ADD_EVENT_LIBRARY_INTERFACE "${LIB_NAME}_static") + + target_link_libraries("${LIB_NAME}_static" PRIVATE ${CMAKE_REQUIRED_LIBRARIES}) endif() if (${EVENT_LIBRARY_SHARED}) @@ -81,7 +83,8 @@ macro(add_event_library LIB_NAME) target_link_libraries("${LIB_NAME}_shared" ${CMAKE_THREAD_LIBS_INIT} ${LIB_PLATFORM} - ${LIB_LIBRARIES}) + ${LIB_LIBRARIES} + ${CMAKE_REQUIRED_LIBRARIES}) if (EVENT_SHARED_FLAGS) set_event_shared_lib_flags("${LIB_NAME}" "${EVENT_SHARED_FLAGS}")