diff --git a/CMake/Platforms/WindowsCache.cmake b/CMake/Platforms/WindowsCache.cmake index dc589ca919..ad468a8f15 100644 --- a/CMake/Platforms/WindowsCache.cmake +++ b/CMake/Platforms/WindowsCache.cmake @@ -88,11 +88,6 @@ if(NOT UNIX) set(TIME_WITH_SYS_TIME 0) set(HAVE_O_NONBLOCK 0) set(HAVE_IN_ADDR_T 0) - if(ENABLE_IPV6) - set(HAVE_GETADDRINFO 1) - else() - set(HAVE_GETADDRINFO 0) - endif() set(STDC_HEADERS 1) set(HAVE_SIGACTION 0) diff --git a/CMakeLists.txt b/CMakeLists.txt index f8cdf1aab8..cb597ca8ea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1291,7 +1291,22 @@ if(WIN32) list(APPEND CURL_LIBS "advapi32" "crypt32") endif() - list(APPEND CURL_LIBS "bcrypt") + # Matching logic used for Curl_win32_random() + if(MINGW) + check_c_source_compiles(" + #include <_mingw.h> + #if defined(__MINGW64_VERSION_MAJOR) + #error + #endif + int main(void) { + return 0; + }" + HAVE_MINGW_ORIGINAL) + endif() + + if(NOT HAVE_MINGW_ORIGINAL) + list(APPEND CURL_LIBS "bcrypt") + endif() endif() if(MSVC)