Add a feature for DNS lookup support
Exclude the relevant files from being built if it is disabled, and add QT_REQUIRE_CONFIG(dnslookup) to the headers. Change-Id: I3af298dc87d63c93f724928dd1135c20eba33045 Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>bb10
parent
b0c895fa7a
commit
9bd30943ba
|
|
@ -293,6 +293,12 @@
|
|||
"section": "Networking",
|
||||
"condition": "features.temporaryfile",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"dnslookup": {
|
||||
"label": "QDnsLookup",
|
||||
"purpose": "Provides API for DNS lookups.",
|
||||
"section": "Networking",
|
||||
"output": [ "publicFeature" ]
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -7,8 +7,6 @@ HEADERS += kernel/qtnetworkglobal.h \
|
|||
kernel/qtnetworkglobal_p.h \
|
||||
kernel/qauthenticator.h \
|
||||
kernel/qauthenticator_p.h \
|
||||
kernel/qdnslookup.h \
|
||||
kernel/qdnslookup_p.h \
|
||||
kernel/qhostaddress.h \
|
||||
kernel/qhostaddress_p.h \
|
||||
kernel/qhostinfo.h \
|
||||
|
|
@ -21,7 +19,6 @@ HEADERS += kernel/qtnetworkglobal.h \
|
|||
kernel/qnetworkproxy.h
|
||||
|
||||
SOURCES += kernel/qauthenticator.cpp \
|
||||
kernel/qdnslookup.cpp \
|
||||
kernel/qhostaddress.cpp \
|
||||
kernel/qhostinfo.cpp \
|
||||
kernel/qnetworkdatagram.cpp \
|
||||
|
|
@ -33,15 +30,22 @@ qtConfig(ftp) {
|
|||
SOURCES += kernel/qurlinfo.cpp
|
||||
}
|
||||
|
||||
qtConfig(dnslookup) {
|
||||
HEADERS += kernel/qdnslookup.h \
|
||||
kernel/qdnslookup_p.h
|
||||
|
||||
SOURCES += kernel/qdnslookup.cpp
|
||||
}
|
||||
|
||||
unix {
|
||||
!integrity: SOURCES += kernel/qdnslookup_unix.cpp
|
||||
!integrity:qtConfig(dnslookup): SOURCES += kernel/qdnslookup_unix.cpp
|
||||
SOURCES += kernel/qhostinfo_unix.cpp
|
||||
|
||||
qtConfig(linux-netlink): SOURCES += kernel/qnetworkinterface_linux.cpp
|
||||
else: SOURCES += kernel/qnetworkinterface_unix.cpp
|
||||
}
|
||||
|
||||
android {
|
||||
android:qtConfig(dnslookup) {
|
||||
SOURCES -= kernel/qdnslookup_unix.cpp
|
||||
SOURCES += kernel/qdnslookup_android.cpp
|
||||
}
|
||||
|
|
@ -50,12 +54,12 @@ win32: {
|
|||
SOURCES += kernel/qhostinfo_win.cpp
|
||||
|
||||
!winrt {
|
||||
SOURCES += kernel/qdnslookup_win.cpp \
|
||||
kernel/qnetworkinterface_win.cpp
|
||||
SOURCES += kernel/qnetworkinterface_win.cpp
|
||||
qtConfig(dnslookup): SOURCES += kernel/qdnslookup_win.cpp
|
||||
LIBS_PRIVATE += -ldnsapi -liphlpapi
|
||||
} else {
|
||||
SOURCES += kernel/qdnslookup_winrt.cpp \
|
||||
kernel/qnetworkinterface_winrt.cpp
|
||||
SOURCES += kernel/qnetworkinterface_winrt.cpp
|
||||
qtConfig(dnslookup): SOURCES += kernel/qdnslookup_winrt.cpp
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,6 +47,8 @@
|
|||
#include <QtCore/qsharedpointer.h>
|
||||
#include <QtCore/qstring.h>
|
||||
|
||||
QT_REQUIRE_CONFIG(dnslookup);
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QHostAddress;
|
||||
|
|
|
|||
|
|
@ -60,6 +60,8 @@
|
|||
#include "QtNetwork/qhostaddress.h"
|
||||
#include "private/qobject_p.h"
|
||||
|
||||
QT_REQUIRE_CONFIG(dnslookup);
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
//#define QDNSLOOKUP_DEBUG
|
||||
|
|
|
|||
Loading…
Reference in New Issue