Fix static linking when bearer management plugins are built, part 2

After commit 5f160a3699 moved the code
that's shared across all bearer management plugins into QtNetwork, there
is one piece of code remaining that's shared across the connman and the
networkmanager bearer plugin: The dbus ofono interface code. To avoid
linking that twice (and causing duplicate symbol errors), this patch
moves it into a static platform support library. This way for shared
builds the code is included twice, but for static builds only once.

Change-Id: Idf5414bc22fea45f11c600f28eaea91bb4dc6308
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
Simon Hausmann 2019-10-21 10:09:03 +02:00
parent 6e3b5801d2
commit 7a605edc22
10 changed files with 27 additions and 12 deletions

View File

@ -0,0 +1,15 @@
TARGET = QtLinuxOfonoSupport
MODULE = linuxofono_support
QT = core dbus
CONFIG += static internal_module
DEFINES += QT_NO_CAST_FROM_ASCII
HEADERS += \
qofonoservice_linux_p.h
SOURCES += \
qofonoservice_linux.cpp
load(qt_module)

View File

@ -148,7 +148,7 @@ QOfonoModemInterface::QOfonoModemInterface(const QString &dbusPathName, QObject
{
QDBusConnection::systemBus().connect(QLatin1String(OFONO_SERVICE),
path(),
OFONO_MODEM_INTERFACE,
QLatin1String(OFONO_MODEM_INTERFACE),
QLatin1String("PropertyChanged"),
this,SLOT(propertyChanged(QString,QDBusVariant)));
}

View File

@ -45,3 +45,7 @@ darwin {
qtConfig(vulkan): \
SUBDIRS += vkconvenience
!android:linux*:qtHaveModule(dbus) \
SUBDIRS += linuxofono

View File

@ -1,14 +1,12 @@
TARGET = qconnmanbearer
QT = core network-private dbus
QT = core network-private dbus linuxofono_support_private
HEADERS += qconnmanservice_linux_p.h \
../linux_common/qofonoservice_linux_p.h \
qconnmanengine.h
SOURCES += main.cpp \
qconnmanservice_linux.cpp \
../linux_common/qofonoservice_linux.cpp \
qconnmanengine.cpp
OTHER_FILES += connman.json

View File

@ -54,7 +54,7 @@
#include <private/qbearerengine_impl_p.h>
#include "qconnmanservice_linux_p.h"
#include "../linux_common/qofonoservice_linux_p.h"
#include <private/qofonoservice_linux_p.h>
#include <QMap>
#include <QVariant>

View File

@ -1,15 +1,13 @@
TARGET = qnmbearer
QT = core network-private dbus
QT = core network-private dbus linuxofono_support_private
HEADERS += qnetworkmanagerservice.h \
qnetworkmanagerengine.h \
../linux_common/qofonoservice_linux_p.h
qnetworkmanagerengine.h
SOURCES += main.cpp \
qnetworkmanagerservice.cpp \
qnetworkmanagerengine.cpp \
../linux_common/qofonoservice_linux.cpp
qnetworkmanagerengine.cpp
OTHER_FILES += networkmanager.json

View File

@ -53,7 +53,6 @@
#include <QDBusInterface>
#include <QDBusMessage>
#include <QDBusReply>
#include "../linux_common/qofonoservice_linux_p.h"
#ifndef QT_NO_DBUS

View File

@ -55,7 +55,7 @@
#include "qnetworkmanagerservice.h"
#include "../linux_common/qofonoservice_linux_p.h"
#include <private/qofonoservice_linux_p.h>
#include <QMap>
#include <QVariant>

View File

@ -29,6 +29,7 @@
"QtKmsSupport" => "$basedir/src/platformsupport/kmsconvenience",
"QtEdidSupport" => "$basedir/src/platformsupport/edid",
"QtVulkanSupport" => "$basedir/src/platformsupport/vkconvenience",
"QtLinuxOfonoSupport" => "$basedir/src/platformsupport/linuxofono",
"QtPlatformHeaders" => "$basedir/src/platformheaders",
"QtANGLE/KHR" => "!$basedir/src/3rdparty/angle/include/KHR",
"QtANGLE/GLES2" => "!$basedir/src/3rdparty/angle/include/GLES2",