Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CMake] Update IncludeFindCurl.cmake - better OpenSSL v3+ handling #3354

Merged
merged 1 commit into from
Aug 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion cmake/IncludeFindCurl.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,11 @@ if(CURL_CONFIG_EXECUTABLE)
# NOTE: cURL may list OpenSSL as "OpenSSL", "OpenSSL v3+" (but this is not guaranteed for all build configurations, even *if* OpenSSL is >= 3), etc
# So instead of exact matches, look for any list entry that begins with OpenSSL
set(_curl_hasOpenSSLBackend FALSE)
set(_curl_openSSLBackendName "")
foreach (backend IN LISTS CURL_SUPPORTED_SSL_BACKENDS)
if (backend MATCHES "^OpenSSL.*")
set(_curl_hasOpenSSLBackend TRUE)
set(_curl_openSSLBackendName "${backend}")
endif()
endforeach()
if (_curl_hasOpenSSLBackend)
Expand All @@ -168,7 +170,13 @@ if(CURL_CONFIG_EXECUTABLE)
endif()
else()
# cURL is linked to OpenSSL, but OpenSSL was not found
set(CURL_OPENSSL_REQUIRES_CALLBACKS "UNKNOWN")
if (_curl_openSSLBackendName MATCHES "^OpenSSL v3")
# if cURL OpenSSL backend is "OpenSSL v3+", then we can assume it's >= 3.0, and no callbacks are required
set(CURL_OPENSSL_REQUIRES_CALLBACKS "NO")
else()
# otherwise, unknown
set(CURL_OPENSSL_REQUIRES_CALLBACKS "UNKNOWN")
endif()
endif()
message(STATUS "OpenSSL requires explicit thread-safety callback init: ${CURL_OPENSSL_REQUIRES_CALLBACKS}")
endif()
Expand Down
Loading