diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f8cdf1aab..cb597ca8e 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) |