From 877c0121c982c5c72b5a5a91b9fd1ac9f64facc1 Mon Sep 17 00:00:00 2001 From: Abhishek Lekshmanan Date: Fri, 13 Apr 2018 17:25:54 +0200 Subject: [PATCH] cmake: set OPENSSL_API_1_1 in civetweb conditionally While not ideal, we set the civetweb openssl 1.1 conditional compile based on the openssl version that cmake reports. In future we should make civetweb itself do this based on OPENSSL_VERSION_COMPAT Signed-off-by: Abhishek Lekshmanan --- src/CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2bf655c7d1e..992c3f7a357 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1078,6 +1078,15 @@ if(WITH_RADOSGW) APPEND PROPERTY COMPILE_DEFINITIONS CRYPTO_LIB="${LIBCRYPTO_SONAME}") endif() + if (OPENSSL_FOUND) + # Use cmake to determine openssl version, a TODO is to make + # civetweb itself do this based on openssl_api_compat strings + if (NOT (OPENSSL_VERSION VERSION_LESS "1.1")) + message(STATUS "Setting civetweb to use OPENSSL >= 1.1") + set_property(TARGET civetweb_common_objs + APPEND PROPERTY COMPILE_DEFINITIONS OPENSSL_API_1_1=1) + endif() + endif(OPENSSL_FOUND) add_subdirectory(rgw) endif(WITH_RADOSGW) -- 2.39.5