Convert features.localserver to QT_[REQUIRE_]CONFIG

Move all the logic into socket.pri and clean-up source
code. Build local socket/server only if feature 'localserver'
was enabled.

Task-number: QTBUG-61672
Change-Id: I9f9d1a262df4bb020c8706c7cb5a66b926e0240f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
Timur Pocheptsov 2017-06-28 12:53:40 +02:00
parent d78fd6a1e5
commit 594fe5c463
9 changed files with 32 additions and 64 deletions

View File

@ -43,8 +43,6 @@
QT_BEGIN_NAMESPACE
#ifndef QT_NO_LOCALSERVER
/*!
\class QLocalServer
\since 4.4
@ -496,8 +494,6 @@ bool QLocalServer::waitForNewConnection(int msec, bool *timedOut)
return !d->pendingConnections.isEmpty();
}
#endif
QT_END_NAMESPACE
#include "moc_qlocalserver.cpp"

View File

@ -43,11 +43,10 @@
#include <QtNetwork/qtnetworkglobal.h>
#include <QtNetwork/qabstractsocket.h>
QT_REQUIRE_CONFIG(localserver);
QT_BEGIN_NAMESPACE
#ifndef QT_NO_LOCALSERVER
class QLocalSocket;
class QLocalServerPrivate;
@ -103,8 +102,6 @@ private:
Q_DECLARE_OPERATORS_FOR_FLAGS(QLocalServer::SocketOptions)
#endif // QT_NO_LOCALSERVER
QT_END_NAMESPACE
#endif // QLOCALSERVER_H

View File

@ -53,12 +53,12 @@
#include <QtNetwork/private/qtnetworkglobal_p.h>
#ifndef QT_NO_LOCALSERVER
#include "qlocalserver.h"
#include "private/qobject_p.h"
#include <qqueue.h>
QT_REQUIRE_CONFIG(localserver);
#if defined(QT_LOCALSOCKET_TCP)
# include <qtcpserver.h>
#elif defined(Q_OS_WIN)
@ -128,7 +128,5 @@ public:
QT_END_NAMESPACE
#endif // QT_NO_LOCALSERVER
#endif // QLOCALSERVER_P_H

View File

@ -44,8 +44,6 @@
#include "qnet_unix_p.h"
#include "qtemporarydir.h"
#ifndef QT_NO_LOCALSERVER
#include <sys/socket.h>
#include <sys/un.h>
@ -341,5 +339,3 @@ void QLocalServerPrivate::setError(const QString &function)
}
QT_END_NAMESPACE
#endif // QT_NO_LOCALSERVER

View File

@ -40,8 +40,6 @@
#include "qlocalsocket.h"
#include "qlocalsocket_p.h"
#ifndef QT_NO_LOCALSOCKET
QT_BEGIN_NAMESPACE
/*!
@ -560,6 +558,4 @@ QDebug operator<<(QDebug debug, QLocalSocket::LocalSocketState state)
QT_END_NAMESPACE
#endif
#include "moc_qlocalsocket.cpp"

View File

@ -44,11 +44,10 @@
#include <QtCore/qiodevice.h>
#include <QtNetwork/qabstractsocket.h>
QT_REQUIRE_CONFIG(localserver);
QT_BEGIN_NAMESPACE
#ifndef QT_NO_LOCALSOCKET
class QLocalSocketPrivate;
class Q_NETWORK_EXPORT QLocalSocket : public QIODevice
@ -148,8 +147,6 @@ Q_NETWORK_EXPORT QDebug operator<<(QDebug, QLocalSocket::LocalSocketError);
Q_NETWORK_EXPORT QDebug operator<<(QDebug, QLocalSocket::LocalSocketState);
#endif
#endif // QT_NO_LOCALSOCKET
QT_END_NAMESPACE
#endif // QLOCALSOCKET_H

View File

@ -53,13 +53,13 @@
#include <QtNetwork/private/qtnetworkglobal_p.h>
#ifndef QT_NO_LOCALSOCKET
#include "qlocalsocket.h"
#include "private/qiodevice_p.h"
#include <qtimer.h>
QT_REQUIRE_CONFIG(localserver);
#if defined(QT_LOCALSOCKET_TCP)
# include "qtcpsocket.h"
#elif defined(Q_OS_WIN)
@ -161,7 +161,5 @@ public:
QT_END_NAMESPACE
#endif // QT_NO_LOCALSOCKET
#endif // QLOCALSOCKET_P_H

View File

@ -41,8 +41,6 @@
#include "qlocalsocket_p.h"
#include "qnet_unix_p.h"
#ifndef QT_NO_LOCALSOCKET
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
@ -555,5 +553,3 @@ bool QLocalSocket::waitForReadyRead(int msecs)
}
QT_END_NAMESPACE
#endif

View File

@ -8,10 +8,6 @@ HEADERS += socket/qabstractsocketengine_p.h \
socket/qudpsocket.h \
socket/qtcpserver.h \
socket/qtcpsocket_p.h \
socket/qlocalserver.h \
socket/qlocalserver_p.h \
socket/qlocalsocket.h \
socket/qlocalsocket_p.h \
socket/qtcpserver_p.h
SOURCES += socket/qabstractsocketengine.cpp \
@ -19,9 +15,7 @@ SOURCES += socket/qabstractsocketengine.cpp \
socket/qabstractsocket.cpp \
socket/qtcpsocket.cpp \
socket/qudpsocket.cpp \
socket/qtcpserver.cpp \
socket/qlocalsocket.cpp \
socket/qlocalserver.cpp
socket/qtcpserver.cpp
# SOCK5 support.
@ -49,42 +43,42 @@ qtConfig(sctp) {
HEADERS += socket/qnativesocketengine_p.h
}
unix: {
SOURCES += socket/qnativesocketengine_unix.cpp \
socket/qlocalsocket_unix.cpp \
socket/qlocalserver_unix.cpp
unix {
SOURCES += socket/qnativesocketengine_unix.cpp
HEADERS += socket/qnet_unix_p.h
}
unix:HEADERS += \
socket/qnet_unix_p.h
# Suppress deprecation warnings with moc because MS headers have
# invalid C/C++ code otherwise.
msvc: QMAKE_MOC_OPTIONS += -D_WINSOCK_DEPRECATED_NO_WARNINGS
win32:!winrt:SOURCES += socket/qnativesocketengine_win.cpp \
socket/qlocalsocket_win.cpp \
socket/qlocalserver_win.cpp
win32:!winrt:SOURCES += socket/qnativesocketengine_win.cpp
win32:!winrt:LIBS_PRIVATE += -ladvapi32
winrt {
SOURCES += socket/qnativesocketengine_winrt.cpp \
socket/qlocalsocket_tcp.cpp \
socket/qlocalserver_tcp.cpp
SOURCES += socket/qnativesocketengine_winrt.cpp
HEADERS += socket/qnativesocketengine_winrt_p.h
DEFINES += QT_LOCALSOCKET_TCP
}
integrity: {
SOURCES -= socket/qlocalsocket_unix.cpp \
socket/qlocalserver_unix.cpp
SOURCES += socket/qlocalsocket_tcp.cpp \
socket/qlocalserver_tcp.cpp \
socket/qnativesocketengine_unix.cpp
qtConfig(localserver) {
HEADERS += socket/qlocalserver.h \
socket/qlocalserver_p.h \
socket/qlocalsocket.h \
socket/qlocalsocket_p.h
SOURCES += socket/qlocalsocket.cpp \
socket/qlocalserver.cpp
DEFINES += QT_LOCALSOCKET_TCP
intergrity|winrt {
SOURCES += socket/qlocalsocket_tcp.cpp \
socket/qlocalserver_tcp.cpp
DEFINES += QT_LOCALSOCKET_TCP
} else: unix {
SOURCES += socket/qlocalsocket_unix.cpp \
socket/qlocalserver_unix.cpp
} else: win32 {
SOURCES += socket/qlocalsocket_win.cpp \
socket/qlocalserver_win.cpp
}
}
qtConfig(system-proxies) {