summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2019-09-29 09:51:35 +0200
committerSander Vrijders <sander@ouroboros.rocks>2019-09-29 12:59:35 +0200
commite87cf19efdd5e3c8acf9b637f34b70182e3d2824 (patch)
tree101651ffcac121822b0c6b07e23c94bd2e719178
parenta1b78cc9d107917e6a2afbe0523a945f9be9dd6d (diff)
downloadouroboros-e87cf19efdd5e3c8acf9b637f34b70182e3d2824.tar.gz
ouroboros-e87cf19efdd5e3c8acf9b637f34b70182e3d2824.zip
build: Check OpenSSL version >= 1.1.0
The cryptographic functions require at least OpenSSL 1.1.0. The build will now check for this version and disable OpenSSL support when this requirement is not met. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
-rw-r--r--src/lib/CMakeLists.txt25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt
index 1a3c6ba3..31a7742b 100644
--- a/src/lib/CMakeLists.txt
+++ b/src/lib/CMakeLists.txt
@@ -86,8 +86,8 @@ if (LIBGCRYPT_LIBRARIES)
unset(HAVE_LIBGCRYPT CACHE)
endif()
else ()
- message(STATUS "Install version > \"1.7.0\" to enable libgcrypt support "
- "(found version \"${GCVER})\"")
+ message(STATUS "Install version >= \"1.7.0\" to enable libgcrypt support "
+ "(found version \"${GCVER}\")")
endif()
endif ()
endif ()
@@ -99,14 +99,19 @@ endif ()
find_package(OpenSSL QUIET)
if (OPENSSL_FOUND)
- set(DISABLE_OPENSSL FALSE CACHE BOOL "Disable OpenSSL support")
- if (NOT DISABLE_OPENSSL)
- message(STATUS "OpenSSL support enabled")
- set(HAVE_OPENSSL TRUE)
- else()
- message(STATUS "OpenSSL support disabled by user")
- unset(HAVE_OPENSSL)
- endif()
+ if (OPENSSL_VERSION VERSION_LESS "1.1.0")
+ message(STATUS "Install version >= \"1.1.0\" to enable OpenSSL support "
+ "(found version \"${OPENSSL_VERSION}\")")
+ else ()
+ set(DISABLE_OPENSSL FALSE CACHE BOOL "Disable OpenSSL support")
+ if (NOT DISABLE_OPENSSL)
+ message(STATUS "OpenSSL support enabled")
+ set(HAVE_OPENSSL TRUE)
+ else()
+ message(STATUS "OpenSSL support disabled")
+ unset(HAVE_OPENSSL)
+ endif()
+ endif ()
endif ()
if (NOT HAVE_OPENSSL)