- `HAVE_LIBWINMM` was detected but unused. The `winmm` system library is
also not used by curl, but it is by its optional dependency `librtmp`.
Change the logic to always add `winmm` when `USE_LIBRTMP` is set. This
library has been available since the early days of Windows.
- `HAVE_LIBWS2_32` detected `ws2_32` lib on Windows. This lib is present
since Windows 95 OSR2 (AFAIR). Winsock1 already wasn't supported and
other existing logic already assumed this lib being present, so delete
the check and replace the detection variable with `WIN32` and always
add `ws2_32` on Windows.
Closes #11612
set(_source_epilogue
"${_source_epilogue}\n#ifndef WIN32_LEAN_AND_MEAN\n#define WIN32_LEAN_AND_MEAN\n#endif")
set(signature_call_conv "PASCAL")
- if(HAVE_LIBWS2_32)
+ if(WIN32)
set(CMAKE_REQUIRED_LIBRARIES ws2_32)
endif()
else()
}" HAVE_POLL_FINE)
endif()
endif()
-
check_function_exists(gethostname HAVE_GETHOSTNAME)
if(WIN32)
- check_library_exists_concat("ws2_32" getch HAVE_LIBWS2_32)
- check_library_exists_concat("winmm" getch HAVE_LIBWINMM)
+ list(APPEND CURL_LIBS "ws2_32")
+ if(USE_LIBRTMP)
+ list(APPEND CURL_LIBS "winmm")
+ endif()
# Matching logic used for Curl_win32_random()
if(MINGW)
endif()
# Check for some functions that are used
-if(HAVE_LIBWS2_32)
+if(WIN32)
set(CMAKE_REQUIRED_LIBRARIES ws2_32)
elseif(HAVE_LIBSOCKET)
set(CMAKE_REQUIRED_LIBRARIES socket)