diff --git a/CMake/OtherTests.cmake b/CMake/OtherTests.cmake index fa1e458e61..762e6d1a5e 100644 --- a/CMake/OtherTests.cmake +++ b/CMake/OtherTests.cmake @@ -38,7 +38,7 @@ if(HAVE_WINDOWS_H) 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() @@ -133,4 +133,3 @@ if(NOT CMAKE_CROSSCOMPILING) }" HAVE_POLL_FINE) endif() endif() - diff --git a/CMakeLists.txt b/CMakeLists.txt index 706d9db41e..5b2427d4f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -371,8 +371,10 @@ check_library_exists_concat("socket" connect HAVE_LIBSOCKET) 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) @@ -1075,7 +1077,7 @@ if(NOT CMAKE_CROSSCOMPILING) 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)