From bc948965f1ac9844a24da5bfc087481c1c4580fd Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 18 Aug 2023 16:03:27 +0200 Subject: [PATCH] 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. Task-number: QTBUG-112957 Change-Id: Ib6ed891a84c6b118836497d6ead48019bb1b9052 Reviewed-by: Qt CI Bot Reviewed-by: Axel Spoerl (cherry picked from commit 409469ba14633545f8cf445baf9ffc286d491094) Reviewed-by: Qt Cherry-pick Bot --- src/network/access/qnetworkaccessmanager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp index e6fea590bd8..b83f2561d38 100644 --- a/src/network/access/qnetworkaccessmanager.cpp +++ b/src/network/access/qnetworkaccessmanager.cpp @@ -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