explicit link to ws2_32 if targeting Windows
#pragma comment(lib,"Ws2_32.lib") in endian.h is a hack and is not portable. It only works for Visual Studio, not gcc or clang on Windows.
This commit is contained in:
parent
a1526bad8d
commit
2b17473cd6
|
|
@ -92,6 +92,10 @@ else()
|
|||
add_library(${PROJECT_NAME} STATIC ${src_MAIN} ${src_LINUX_TCP})
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC ws2_32)
|
||||
endif()
|
||||
|
||||
# install rules
|
||||
# ------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue