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 <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Joerg Bornemann 2022-07-06 09:18:22 +02:00
parent a6acb2453f
commit d754e43721

View File

@ -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()