QCryptographicHash: only use OpenSSL 3.0 when OpenSSL will be linked

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 <marten.nordheim@qt.io>
This commit is contained in:
Jan Grulich 2022-09-27 12:28:39 +02:00
parent 6b6aeef217
commit 491dc83bbf
3 changed files with 3 additions and 10 deletions

View File

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

View File

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

View File

@ -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 <openssl/evp.h>
#include <openssl/provider.h>