]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: set OPENSSL_API_1_1 in civetweb conditionally
authorAbhishek Lekshmanan <abhishek@suse.com>
Fri, 13 Apr 2018 15:25:54 +0000 (17:25 +0200)
committerAbhishek Lekshmanan <abhishek@suse.com>
Fri, 13 Apr 2018 17:25:45 +0000 (19:25 +0200)
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 <abhishek@suse.com>
src/CMakeLists.txt

index 2bf655c7d1ef43176930157400c9a63096888025..992c3f7a35755cd2cdebbe2f77f403ca147bb57a 100644 (file)
@@ -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)