[patches] [PATCH] [http client] Check if libcurl supports SSL
Konstantin Osipov
kostja at tarantool.org
Thu Mar 1 22:30:52 MSK 2018
JFYI, in CMake we use 4 spaces for indent. I don't remember why.
I will push the patch now, it looks good enough for me.
* Konstantin Belyavskiy <k.belyavskiy at tarantool.org> [18/03/01 18:35]:
> Close #3065
> ---
> branch: gh-3065-check-curl-ssl-support
>
> cmake/FindCURL.cmake | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
>
> diff --git a/cmake/FindCURL.cmake b/cmake/FindCURL.cmake
> index 098544ab2..c71652568 100644
> --- a/cmake/FindCURL.cmake
> +++ b/cmake/FindCURL.cmake
> @@ -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()
--
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.org - www.twitter.com/kostja_osipov
More information about the Tarantool-patches
mailing list