From fcb548878bfae3db34d482f3ad97074aca76b410 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 1 Aug 2023 12:11:30 -0700 Subject: [PATCH] CMake/Network: limit the testing for some network iface features MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These features are now only used for qnetworkinterface_unix.cpp, so they aren't needed for Windows or for Linux with AF_NETLINK support. This commit removes the last couple of placess outside of that file where they were used (the qnativesocketengine_unix.cpp code looked stale anyway). These tests cost us approximately 1300 ms during CMake time. This commit does not change that because the tests are checked even if the condition has already been forced OFF by previous conditions. [ChangeLog][Build system] The QT_NO_GETIFADDRS and QT_NO_IPV6IFNAME macros are deprecated. On a standard Linux build, they will be defined to 1, even if the system does support getifaddrs() and ifnametoindex(). Task-number: QTBUG-107248 Task-number: QTBUG-115705 Change-Id: Ifbf974a4d10745b099b1fffd17775822a1a6e55f Reviewed-by: MÃ¥rten Nordheim --- src/network/configure.cmake | 6 +++--- src/network/socket/qnativesocketengine_unix.cpp | 13 ------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/src/network/configure.cmake b/src/network/configure.cmake index f24f739ce2..8a9ad6b614 100644 --- a/src/network/configure.cmake +++ b/src/network/configure.cmake @@ -209,16 +209,16 @@ connectionPointContainer->FindConnectionPoint(IID_INetworkConnectionEvents, &con qt_feature("getifaddrs" PUBLIC LABEL "getifaddrs()" - CONDITION TEST_getifaddrs + CONDITION UNIX AND NOT QT_FEATURE_linux_netlink AND TEST_getifaddrs ) qt_feature_definition("getifaddrs" "QT_NO_GETIFADDRS" NEGATE VALUE "1") qt_feature("ifr_index" PRIVATE LABEL "ifr_index" - CONDITION TEST_ifr_index + CONDITION UNIX AND NOT QT_FEATURE_linux_netlink AND TEST_ifr_index ) qt_feature("ipv6ifname" PUBLIC LABEL "IPv6 ifname" - CONDITION TEST_ipv6ifname + CONDITION UNIX AND NOT QT_FEATURE_linux_netlink AND TEST_ipv6ifname ) qt_feature_definition("ipv6ifname" "QT_NO_IPV6IFNAME" NEGATE VALUE "1") qt_feature("libresolv" PRIVATE diff --git a/src/network/socket/qnativesocketengine_unix.cpp b/src/network/socket/qnativesocketengine_unix.cpp index d5f2bfbac4..98e9ec803e 100644 --- a/src/network/socket/qnativesocketengine_unix.cpp +++ b/src/network/socket/qnativesocketengine_unix.cpp @@ -17,19 +17,6 @@ #include #include #include -#ifndef QT_NO_IPV6IFNAME -#ifdef Q_OS_LINUX -#include -#else // Q_OS_LINUX -#include -#endif // !Q_OS_LINUX -#endif -#ifdef QT_LINUXBASE -#include -#endif -#ifdef Q_OS_BSD4 -#include -#endif #ifdef Q_OS_INTEGRITY #include #endif