Skip to content
Snippets Groups Projects
Commit 5c7ac1ca authored by Konstantin Belyavskiy's avatar Konstantin Belyavskiy Committed by Konstantin Osipov
Browse files

[http client] Check if libcurl supports SSL

On MAC several old curl versions don't support SSL by default.
Try to check it and print error message if so.

Close #3065
parent dd29343a
No related branches found
No related tags found
No related merge requests found
......@@ -68,4 +68,24 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(CURL
if(CURL_FOUND)
set(CURL_LIBRARIES ${CURL_LIBRARY})
set(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${CURL_LIBRARIES})
set(CMAKE_REQUIRED_INCLUDES ${CURL_INCLUDE_DIRS})
check_c_source_runs("
#include <curl/curl.h>
int main()
{
#ifdef CURL_VERSION_SSL
curl_version_info_data *data = curl_version_info(CURLVERSION_NOW);
if (data->features & CURL_VERSION_SSL)
return 0;
#endif
return -1;
}
" CURL_SUPPORTS_SSL)
set(CMAKE_REQUIRED_LIBRARIES "")
set(CMAKE_REQUIRED_INCLUDES "")
if (NOT DEFINED CURL_SUPPORTS_SSL_EXITCODE OR CURL_SUPPORTS_SSL_EXITCODE)
message(FATAL_ERROR "Curl was build without SSL support")
endif()
endif()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment