diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 132f243..f00fc8f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -57,6 +57,7 @@ else() endif() find_package(WolfSSL) find_package(MbedTLS) + find_package(ZLIB) if(UHTTPD_USE_OPENSSL) if (NOT OPENSSL_FOUND) @@ -97,7 +98,11 @@ else() elseif(UHTTPD_USE_MBEDTLS) set(SSL_NAME "MbedTLS(PolarSSL)") set(SSL_INC ${MBEDTLS_INCLUDE_DIR}) - set(SSL_LIB ${MBEDTLS_LIBRARIES}) + if(ZLIB_FOUND) + set(SSL_LIB ${MBEDTLS_LIBRARIES} ${ZLIB_LIBRARIES}) + else() + set(SSL_LIB ${MBEDTLS_LIBRARIES}) + endif() set(UHTTPD_HAVE_MBEDTLS_CONFIG 1) endif()