]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cmake: link `crypt32` for OpenSSL feature detection
authorViktor Szakats <commit@vsz.me>
Sat, 19 Apr 2025 07:34:35 +0000 (09:34 +0200)
committerViktor Szakats <commit@vsz.me>
Sun, 20 Apr 2025 07:36:32 +0000 (09:36 +0200)
Also fix to link the winsock library for WinCE there.

Reported-by: Jixinqi
Fixes #17101
Closes #17102

CMakeLists.txt

index 34caee3a2f893589b602c1ce9a0905c75ee86d3c..f93a082f116cb6fced34b67f1c12eb3be58e1081 100644 (file)
@@ -1025,7 +1025,6 @@ macro(curl_openssl_check_exists)
       list(APPEND CMAKE_REQUIRED_LIBRARIES ZLIB::ZLIB)
     endif()
     if(WIN32 AND NOT WINCE)
-      list(APPEND CMAKE_REQUIRED_LIBRARIES "${_win32_winsock}")
       list(APPEND CMAKE_REQUIRED_LIBRARIES "bcrypt")  # for OpenSSL/LibreSSL
     endif()
   endif()
@@ -1036,11 +1035,11 @@ macro(curl_openssl_check_exists)
     if(HAVE_LIBZ)
       list(APPEND CMAKE_REQUIRED_LIBRARIES ZLIB::ZLIB)  # Public wolfSSL headers also require zlib headers
     endif()
-    if(WIN32)
-      list(APPEND CMAKE_REQUIRED_LIBRARIES "${_win32_winsock}" "${_win32_crypt32}")
-    endif()
     list(APPEND CMAKE_REQUIRED_DEFINITIONS "-DHAVE_UINTPTR_T")  # to pull in stdint.h (as of wolfSSL v5.5.4)
   endif()
+  if(WIN32)
+    list(APPEND CMAKE_REQUIRED_LIBRARIES "${_win32_winsock}" "${_win32_crypt32}")  # for OpenSSL/wolfSSL
+  endif()
   if(${ARGC} EQUAL 2)
     check_function_exists(${ARGN})
   else()