From 491dc83bbf87e0636fea9875e4ef0cf305b92e20 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Tue, 27 Sep 2022 12:28:39 +0200 Subject: [PATCH] QCryptographicHash: only use OpenSSL 3.0 when OpenSSL will be linked MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OpenSSL by default doesn't provide static libraries and we would fail to build it in such case. Fixes: QTBUG-106978 Change-Id: I456fe9bec2bbef5003de8f6cb7d9d8bb226821f9 Reviewed-by: MÃ¥rten Nordheim --- configure.cmake | 2 +- src/corelib/CMakeLists.txt | 7 ------- src/corelib/tools/qcryptographichash.cpp | 4 ++-- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/configure.cmake b/configure.cmake index 30b99d4998..91a3df5f33 100644 --- a/configure.cmake +++ b/configure.cmake @@ -1062,7 +1062,7 @@ qt_feature("openssl-runtime" ENABLE INPUT_openssl STREQUAL 'yes' OR INPUT_openssl STREQUAL 'runtime' DISABLE INPUT_openssl STREQUAL 'no' OR INPUT_openssl STREQUAL 'linked' OR INPUT_ssl STREQUAL 'no' ) -qt_feature("openssl-linked" PRIVATE +qt_feature("openssl-linked" PUBLIC LABEL " Qt directly linked to OpenSSL" AUTODETECT OFF CONDITION TEST_opensslv11 OR TEST_opensslv30 diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 1b41c659dc..49d84251ad 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -841,13 +841,6 @@ qt_internal_extend_target(Core CONDITION QT_FEATURE_openssl_linked AND QT_FEATUR WrapOpenSSL::WrapOpenSSL ) -qt_internal_extend_target(Core CONDITION NOT QT_FEATURE_openssl AND QT_FEATURE_opensslv30 - LIBRARIES - WrapOpenSSLHeaders::WrapOpenSSLHeaders - PRIVATE_MODULE_INTERFACE - WrapOpenSSLHeaders::WrapOpenSSLHeaders -) - qt_internal_extend_target(Core CONDITION QT_FEATURE_hijricalendar SOURCES time/qhijricalendar.cpp time/qhijricalendar_p.h diff --git a/src/corelib/tools/qcryptographichash.cpp b/src/corelib/tools/qcryptographichash.cpp index 98b4537dee..65aca959cb 100644 --- a/src/corelib/tools/qcryptographichash.cpp +++ b/src/corelib/tools/qcryptographichash.cpp @@ -12,7 +12,7 @@ #endif #ifndef QT_CRYPTOGRAPHICHASH_ONLY_SHA1 -#if !QT_CONFIG(opensslv30) +#if !QT_CONFIG(opensslv30) || !QT_CONFIG(openssl_linked) // qdoc and qmake only need SHA-1 #include "../../3rdparty/md5/md5.h" #include "../../3rdparty/md5/md5.cpp" @@ -104,7 +104,7 @@ static inline int SHA384_512AddLength(SHA512Context *context, unsigned int lengt #endif #endif // QT_CRYPTOGRAPHICHASH_ONLY_SHA1 -#if !defined(QT_BOOTSTRAPPED) && QT_CONFIG(opensslv30) +#if !defined(QT_BOOTSTRAPPED) && QT_CONFIG(opensslv30) && QT_CONFIG(openssl_linked) #define USING_OPENSSL30 #include #include