Add zlib to libs when finding openssl (RIPD-1496):

if openssl is configured with compression support AND you link
to the static lib, you are going to need to link to zlib.

Fundamentally the CMake finder should take care of this (as
described in https://gitlab.kitware.com/cmake/cmake/issues/16885),
but we work around it here by adding zlib explicitly. Update
beast error test for OpenSSL 1.1.0
This commit is contained in:
Mike Ellery
2017-07-21 14:34:19 -07:00
committed by Nik Bougalis
parent 60dd194b72
commit 36423a5f77
2 changed files with 11 additions and 0 deletions

View File

@@ -388,6 +388,11 @@ macro(use_openssl openssl_min)
endif()
find_package(OpenSSL)
# depending on how openssl is built, it might depend
# on zlib. In fact, the openssl find package should
# figure this out for us, but it does not currently...
# so let's add zlib ourselves to the lib list
find_package(ZLIB)
if (static)
set(CMAKE_FIND_LIBRARY_SUFFIXES tmp)
@@ -395,6 +400,7 @@ macro(use_openssl openssl_min)
if (OPENSSL_FOUND)
include_directories(${OPENSSL_INCLUDE_DIR})
list(APPEND OPENSSL_LIBRARIES ${ZLIB_LIBRARIES})
else()
message(FATAL_ERROR "OpenSSL not found")
endif()