cmake: add GnuTLS option

- Option to use GNUTLS was missing. Hence was not able to use GNUTLS
  with ngtcp2 for http3.

Closes #11685
This commit is contained in:
Mathew Benson 2023-08-17 02:09:33 +03:00 committed by Daniel Stenberg
parent eb3b049df5
commit 9ec764ee1f
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -405,6 +405,7 @@ endif()
cmake_dependent_option(CURL_USE_MBEDTLS "Enable mbedTLS for SSL/TLS" OFF CURL_ENABLE_SSL OFF)
cmake_dependent_option(CURL_USE_BEARSSL "Enable BearSSL for SSL/TLS" OFF CURL_ENABLE_SSL OFF)
cmake_dependent_option(CURL_USE_WOLFSSL "enable wolfSSL for SSL/TLS" OFF CURL_ENABLE_SSL OFF)
cmake_dependent_option(CURL_USE_GNUTLS "Enable GNUTLS for SSL/TLS" OFF CURL_ENABLE_SSL OFF)
set(openssl_default ON)
if(WIN32 OR CURL_USE_SECTRANSP OR CURL_USE_SCHANNEL OR CURL_USE_MBEDTLS OR CURL_USE_WOLFSSL)
@ -511,6 +512,11 @@ if(CURL_USE_WOLFSSL)
include_directories(${WolfSSL_INCLUDE_DIRS})
endif()
if(CURL_USE_GNUTLS)
set(SSL_ENABLED ON)
set(USE_GNUTLS ON)
endif()
# Keep ZLIB detection after TLS detection,
# and before calling openssl_check_symbol_exists().
@ -1444,7 +1450,7 @@ endmacro()
# NTLM support requires crypto function adaptions from various SSL libs
# TODO alternative SSL libs tests for SSP1, GNUTLS, NSS
if(NOT (CURL_DISABLE_CRYPTO_AUTH OR CURL_DISABLE_NTLM) AND
(USE_OPENSSL OR USE_MBEDTLS OR USE_DARWINSSL OR USE_WIN32_CRYPTO))
(USE_OPENSSL OR USE_MBEDTLS OR USE_DARWINSSL OR USE_WIN32_CRYPTO OR USE_GNUTLS))
set(use_curl_ntlm_core ON)
endif()
@ -1544,6 +1550,8 @@ _add_if("Secure Transport" SSL_ENABLED AND USE_SECTRANSP)
_add_if("mbedTLS" SSL_ENABLED AND USE_MBEDTLS)
_add_if("BearSSL" SSL_ENABLED AND USE_BEARSSL)
_add_if("wolfSSL" SSL_ENABLED AND USE_WOLFSSL)
_add_if("GnuTLS" SSL_ENABLED AND USE_GNUTLS)
if(_items)
list(SORT _items)
endif()