CMake: Fix build when developer-build is on but private_tests is OFF

If qt is first configured without -developer-build, and then
reconfigured with -developer-build, QT_FEATURE_developer_build will be
ON but QT_FEATURE_private_tests remains OFF, and is not reset to ON.

This causes a link failure in Network, because the source files
defining the QNetworkAccessDebugPipeBackendFactory class are only
added if QT_FEATURE_private_tests is ON, which is not the case above,
but the C++ code checks for the QT_INTERNAL_BUILD define which is
defined when -developer-build is ON.

Align the C++ code to check for the private_tests feature.

Pick-to: 6.5 6.6
Task-number: QTBUG-112957
Change-Id: Ib6ed891a84c6b118836497d6ead48019bb1b9052
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
This commit is contained in:
Alexandru Croitor 2023-08-18 16:03:27 +02:00
parent 93637ea296
commit 409469ba14

View File

@ -73,7 +73,7 @@ Q_LOGGING_CATEGORY(lcQnam, "qt.network.access.manager")
Q_APPLICATION_STATIC(QNetworkAccessFileBackendFactory, fileBackend)
#ifdef QT_BUILD_INTERNAL
#if QT_CONFIG(private_tests)
Q_GLOBAL_STATIC(QNetworkAccessDebugPipeBackendFactory, debugpipeBackend)
#endif
@ -153,7 +153,7 @@ bool getProxyAuth(const QString& proxyHostname, const QString &scheme, QString&
static void ensureInitialized()
{
#ifdef QT_BUILD_INTERNAL
#if QT_CONFIG(private_tests)
(void) debugpipeBackend();
#endif