From d754e43721e4f40a8dffa8b69ef883ca383a4a61 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 6 Jul 2022 09:18:22 +0200 Subject: Make WrapOpenSSLHeaders an optional dependency of the OpenSSL plugin When configuring Qt statically with OpenSSL support on macOS, configuring a user project would fail, because WrapOpenSSLHeaders could not be found. Configuration fails, because we don't record OPENSSL_ROOT_DIR anywhere, and WrapOpenSSLHeaders is a required dependency of the OpenSSL plugin. Make the WrapOpenSSLHeaders dependency optional like WrapVulkanHeaders for QtGui. Note that when Qt is statically configured with -openssl-linked on macOS, configuration of user projects will still fail like described above. Pick-to: 6.4 Fixes: QTBUG-96283 Change-Id: I0893e18767387ea849c7e5661f5421b71e3f64ab Reviewed-by: Qt CI Bot Reviewed-by: Alexandru Croitor --- src/plugins/tls/openssl/CMakeLists.txt | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/tls/openssl/CMakeLists.txt b/src/plugins/tls/openssl/CMakeLists.txt index a7fb54f08c..489aa32ef6 100644 --- a/src/plugins/tls/openssl/CMakeLists.txt +++ b/src/plugins/tls/openssl/CMakeLists.txt @@ -48,12 +48,10 @@ qt_internal_extend_target(QTlsBackendOpenSSLPlugin CONDITION WIN32 crypt32 ) -qt_internal_extend_target(QTlsBackendOpenSSLPlugin CONDITION QT_FEATURE_openssl_linked - LIBRARIES - WrapOpenSSL::WrapOpenSSL -) - -qt_internal_extend_target(QTlsBackendOpenSSLPlugin CONDITION NOT QT_FEATURE_openssl_linked - LIBRARIES +if(QT_FEATURE_openssl_linked) + target_link_libraries(QTlsBackendOpenSSLPlugin PRIVATE WrapOpenSSL::WrapOpenSSL) +else() + qt_internal_add_target_include_dirs_and_optionally_propagate(QTlsBackendOpenSSLPlugin WrapOpenSSLHeaders::WrapOpenSSLHeaders -) + ) +endif() -- cgit v1.2.3