summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <[email protected]>2023-08-01 12:11:30 -0700
committerThiago Macieira <[email protected]>2023-08-30 23:26:25 -0700
commitfcb548878bfae3db34d482f3ad97074aca76b410 (patch)
tree7cc66c47a2d7845639357650bd958094945c36b8
parent8051edfdb5efcafd76b178990b8ff760342aeee3 (diff)
CMake/Network: limit the testing for some network iface features
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 <[email protected]>
-rw-r--r--src/network/configure.cmake6
-rw-r--r--src/network/socket/qnativesocketengine_unix.cpp13
2 files changed, 3 insertions, 16 deletions
diff --git a/src/network/configure.cmake b/src/network/configure.cmake
index f24f739ce20..8a9ad6b614f 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 d5f2bfbac44..98e9ec803ed 100644
--- a/src/network/socket/qnativesocketengine_unix.cpp
+++ b/src/network/socket/qnativesocketengine_unix.cpp
@@ -17,19 +17,6 @@
#include <time.h>
#include <errno.h>
#include <fcntl.h>
-#ifndef QT_NO_IPV6IFNAME
-#ifdef Q_OS_LINUX
-#include <linux/if.h>
-#else // Q_OS_LINUX
-#include <net/if.h>
-#endif // !Q_OS_LINUX
-#endif
-#ifdef QT_LINUXBASE
-#include <arpa/inet.h>
-#endif
-#ifdef Q_OS_BSD4
-#include <net/if_dl.h>
-#endif
#ifdef Q_OS_INTEGRITY
#include <sys/uio.h>
#endif