summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-03-12 17:18:40 +0100
committerDaniel Stenberg <daniel@haxx.se>2020-03-16 22:56:50 +0100
commit37a05418820dfcdb68bc0d535e76e63945b45917 (patch)
tree332700ffeb5c378e8768309a71a7d52f3f0064a1 /CMakeLists.txt
parent95c36fff75883ace6e8e7a89b94362de2dd1857f (diff)
downloadcurl-37a05418820dfcdb68bc0d535e76e63945b45917.tar.gz
cmake: add support for building with wolfSSLbagder/cmake-wolfssl
My working build cmdline: $ cmake -DCMAKE_PREFIX_PATH=$HOME/build-wolfssl -DCMAKE_USE_WOLFSSL=ON . Assisted-by: Brad King Closes #5095
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt17
1 files changed, 14 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 73b053b31..e412b0520 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -298,7 +298,7 @@ if(WIN32)
endif()
# check SSL libraries
-# TODO support GnuTLS and WolfSSL
+# TODO support GnuTLS
if(APPLE)
option(CMAKE_USE_SECTRANSP "enable Apple OS native SSL/TLS" OFF)
@@ -311,9 +311,10 @@ endif()
option(CMAKE_USE_MBEDTLS "Enable mbedTLS for SSL/TLS" OFF)
option(CMAKE_USE_BEARSSL "Enable BearSSL for SSL/TLS" OFF)
option(CMAKE_USE_NSS "Enable NSS for SSL/TLS" OFF)
+option(CMAKE_USE_WOLFSSL "enable wolfSSL for SSL/TLS" OFF)
set(openssl_default ON)
-if(WIN32 OR CMAKE_USE_SECTRANSP OR CMAKE_USE_WINSSL OR CMAKE_USE_MBEDTLS OR CMAKE_USE_NSS)
+if(WIN32 OR CMAKE_USE_SECTRANSP OR CMAKE_USE_WINSSL OR CMAKE_USE_MBEDTLS OR CMAKE_USE_NSS OR CMAKE_USE_WOLFSSL)
set(openssl_default OFF)
endif()
option(CMAKE_USE_OPENSSL "Use OpenSSL code. Experimental" ${openssl_default})
@@ -325,6 +326,7 @@ count_true(enabled_ssl_options_count
CMAKE_USE_MBEDTLS
CMAKE_USE_BEARSSL
CMAKE_USE_NSS
+ CMAKE_USE_WOLFSSL
)
if(enabled_ssl_options_count GREATER "1")
set(CURL_WITH_MULTI_SSL ON)
@@ -405,6 +407,14 @@ if(CMAKE_USE_BEARSSL)
include_directories(${BEARSSL_INCLUDE_DIRS})
endif()
+if(CMAKE_USE_WOLFSSL)
+ find_package(WolfSSL REQUIRED)
+ set(SSL_ENABLED ON)
+ set(USE_WOLFSSL ON)
+ list(APPEND CURL_LIBS ${WolfSSL_LIBRARIES})
+ include_directories(${WolfSSL_INCLUDE_DIRS})
+endif()
+
if(CMAKE_USE_NSS)
find_package(NSS REQUIRED)
include_directories(${NSS_INCLUDE_DIRS})
@@ -750,7 +760,7 @@ elseif(CURL_CA_PATH_AUTODETECT OR CURL_CA_BUNDLE_AUTODETECT)
endif()
if(CURL_CA_PATH_SET AND NOT USE_OPENSSL AND NOT USE_MBEDTLS)
- message(FATAL_ERROR
+ message(STATUS
"CA path only supported by OpenSSL, GnuTLS or mbed TLS. "
"Set CURL_CA_PATH=none or enable one of those TLS backends.")
endif()
@@ -1311,6 +1321,7 @@ _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("NSS" SSL_ENABLED AND USE_NSS)
+_add_if("wolfSSL" SSL_ENABLED AND USE_WOLFSSL)
if(_items)
list(SORT _items)
endif()