Fix openssl 3 cmake build issues
@@ -18,9 +18,11 @@ option(QUIC_USE_SYSTEM_LIBCRYPTO "Use system libcrypto if openssl TLS" OFF)
# the openssl version cloned
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/openssl/CHANGES")
message(STATUS "Configuring for OpenSSL 1.1")
+ set(EXPECTED_OPENSSL_VERSION 1.1.1)
else()
set(QUIC_USE_OPENSSL3 ON)
message(STATUS "Configuring for OpenSSL 3.0")
+ set(EXPECTED_OPENSSL_VERSION 3.0)
endif()
set(OPENSSL_CONFIG_FLAGS
@@ -34,7 +36,7 @@ set(OPENSSL_CONFIG_FLAGS
no-weak-ssl-ciphers no-shared no-tests)
if (QUIC_USE_OPENSSL3)
- list(APPEND OPENSSL_CONFIG_FLAGS no-uplink no-cmp no-fips no-padlockeng no-siv)
+ list(APPEND OPENSSL_CONFIG_FLAGS no-uplink no-cmp no-fips no-padlockeng no-siv --libdir=lib)
endif()
if (WIN32)
@@ -293,10 +295,10 @@ else()
if (QUIC_USE_SYSTEM_LIBCRYPTO)
include(FindOpenSSL)
if (OPENSSL_FOUND)
- if (OPENSSL_VERSION VERSION_EQUAL 1.1.1)
+ if (OPENSSL_VERSION VERSION_EQUAL EXPECTED_OPENSSL_VERSION)
target_link_libraries(OpenSSLQuic INTERFACE OpenSSL::Crypto)
else()
- message(FATAL_ERROR "OpenSSL 1.1.1 not found, found ${OPENSSL_VERSION}")
+ message(FATAL_ERROR "OpenSSL ${EXPECTED_OPENSSL_VERSION} not found, found ${OPENSSL_VERSION}")
endif()
else()
message(FATAL_ERROR "System OpenSSL not found when requested")
