Convert static common simulator plugins to shared ones

Test Plan:
- Check that the new shared libraries are packaged in all platform installers.
- check that plugins are loaded properly on all platforms.

Reviewers: #swift_pilot_client, msutcliffe

Reviewed By: #swift_pilot_client, msutcliffe

Maniphest Tasks: T471

Differential Revision: https://dev.swift-project.org/D79
This commit is contained in:
Roland Rossgotterer
2018-12-17 15:59:14 +01:00
committed by Mat Sutcliffe
parent 0970dbdcfc
commit d639187f91
28 changed files with 194 additions and 63 deletions

View File

@@ -9,20 +9,24 @@ SOURCES += *.cpp
HEADERS += *.h
FORMS += *.ui
CONFIG += staticlib
CONFIG += blackconfig blackmisc blackcore blackgui simconnect
CONFIG += blackconfig blackmisc blackcore blackgui
CONFIG += simulatorfscommon simulatorplugincommon simconnect
DEPENDPATH += . $$SourceRoot/src
INCLUDEPATH += . $$SourceRoot/src
DESTDIR = $$DestRoot/lib
LIBS += -lsimulatorfscommon -lfsuipc -lsimulatorplugincommon
addStaticLibraryDependency(fsuipc)
addStaticLibraryDependency(simulatorplugincommon)
DEFINES += BUILD_FSXCOMMON_LIB BUID_SIMCONNECT_LIB
OTHER_FILES += \
*.manifest \
*.rc
RC_FILE = $$SourceRoot/src/plugins/simulator/fsxcommon/simconnect.rc
DESTDIR = $$DestRoot/lib
DLLDESTDIR = $$DestRoot/bin
dlltarget.path = $$PREFIX/bin
INSTALLS += dlltarget
load(common_post)

View File

@@ -0,0 +1,32 @@
/* Copyright (C) 2018
* swift project Community / Contributors
*
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
* including this file, may be copied, modified, propagated, or distributed except according to the terms
* contained in the LICENSE file.
*/
//! \file
#ifndef BLACKSIMPLUGIN_FSXCOMMON_SIMULATORFSXCOMMON_MACROS_H
#define BLACKSIMPLUGIN_FSXCOMMON_SIMULATORFSXCOMMON_MACROS_H
#include <QtGlobal>
/*!
* \def FSXCOMMON_EXPORT
* FSXCommon Export Macro
*/
#ifndef WITH_STATIC
# if defined(BUILD_FSXCOMMON_LIB)
# define FSXCOMMON_EXPORT Q_DECL_EXPORT
# else
# define FSXCOMMON_EXPORT Q_DECL_IMPORT
# endif
#else
# define FSXCOMMON_EXPORT
#endif
#endif // guard

View File

@@ -12,6 +12,7 @@
#ifndef BLACKSIMPLUGIN_FSXCOMMON_FSXSETTINGSCOMPONENT_H
#define BLACKSIMPLUGIN_FSXCOMMON_FSXSETTINGSCOMPONENT_H
#include "plugins/simulator/fsxcommon/fsxcommonexport.h"
#include "blackmisc/simulation/simulatorinfo.h"
#include "blackmisc/simulation/simulatorplugininfo.h"
#include <QFrame>
@@ -26,7 +27,7 @@ namespace BlackSimPlugin
class CSimulatorFsxCommon;
//! FSX/P3D settings
class CFsxSettingsComponent : public QFrame
class FSXCOMMON_EXPORT CFsxSettingsComponent : public QFrame
{
Q_OBJECT

View File

@@ -12,11 +12,12 @@
#ifndef BLACKSIMPLUGIN_FSXCOMMON_SIMCONNECT_DATADEFINITION_H
#define BLACKSIMPLUGIN_FSXCOMMON_SIMCONNECT_DATADEFINITION_H
#include <QtGlobal>
#include "plugins/simulator/fsxcommon/fsxcommonexport.h"
#include "plugins/simulator/fsxcommon/simconnectwindows.h"
#include "blackmisc/aviation/aircraftlights.h"
#include "../fsxcommon/simconnectwindows.h"
#include <algorithm>
#include <QtGlobal>
#include <QString>
namespace BlackMisc { namespace Aviation { class CAircraftParts; }}
@@ -86,7 +87,7 @@ namespace BlackSimPlugin
};
//! Data struct of remote aircraft parts
struct DataDefinitionRemoteAircraftPartsWithoutLights
struct FSXCOMMON_EXPORT DataDefinitionRemoteAircraftPartsWithoutLights
{
double flapsLeadingEdgeLeftPercent; //!< Leading edge left in percent
double flapsLeadingEdgeRightPercent; //!< Leading edge right in percent
@@ -128,7 +129,7 @@ namespace BlackSimPlugin
};
//! Data for aircraft lighs
struct DataDefinitionRemoteAircraftLights
struct FSXCOMMON_EXPORT DataDefinitionRemoteAircraftLights
{
double lightStrobe; //!< Is strobe light on?
double lightLanding; //!< Is landing light on?
@@ -206,7 +207,7 @@ namespace BlackSimPlugin
};
//! Handles SimConnect data definitions
class CSimConnectDefinitions
class FSXCOMMON_EXPORT CSimConnectDefinitions
{
public:
//! SimConnect definiton IDs

View File

@@ -12,7 +12,8 @@
#ifndef BLACKSIMPLUGIN_FSXCOMMON_SIMCONNECTOBJECT_H
#define BLACKSIMPLUGIN_FSXCOMMON_SIMCONNECTOBJECT_H
#include "simconnectdatadefinition.h"
#include "plugins/simulator/fsxcommon/fsxcommonexport.h"
#include "plugins/simulator/fsxcommon/simconnectdatadefinition.h"
#include "blackmisc/simulation/simulatedaircraft.h"
#include "blackmisc/simulation/interpolatormulti.h"
#include <QSharedPointer>
@@ -24,7 +25,7 @@ namespace BlackSimPlugin
namespace FsxCommon
{
//! Class representing a SimConnect object
class CSimConnectObject
class FSXCOMMON_EXPORT CSimConnectObject
{
public:
//! Type

View File

@@ -12,6 +12,7 @@
#ifndef BLACKSIMPLUGIN_FSXCOMMON_SIMCONNECTSETTINGSCOMPONENT_H
#define BLACKSIMPLUGIN_FSXCOMMON_SIMCONNECTSETTINGSCOMPONENT_H
#include "plugins/simulator/fsxcommon/fsxcommonexport.h"
#include "blackgui/overlaymessagesframe.h"
#include "blackmisc/settingscache.h"
#include "blackmisc/simulation/settings/simulatorsettings.h"
@@ -27,7 +28,7 @@ namespace BlackSimPlugin
/*!
* A component that gathers all SimConnect related settings.
*/
class CSimConnectSettingsComponent : public BlackGui::COverlayMessagesFrame
class FSXCOMMON_EXPORT CSimConnectSettingsComponent : public BlackGui::COverlayMessagesFrame
{
Q_OBJECT

View File

@@ -12,6 +12,8 @@
#ifndef BLACKSIMPLUGIN_FSXCOMMON_SIMCONNECTSYMBOLS_H
#define BLACKSIMPLUGIN_FSXCOMMON_SIMCONNECTSYMBOLS_H
#include "plugins/simulator/fsxcommon/fsxcommonexport.h"
#include <QtGlobal>
#ifdef Q_OS_WIN64
@@ -26,12 +28,12 @@ enum P3DSimConnectVersion
};
//! String to the enum
P3DSimConnectVersion stringToP3DVersion(const QString &p3d);
FSXCOMMON_EXPORT P3DSimConnectVersion stringToP3DVersion(const QString &p3d);
//! Load and resolve versioned P3D SimConnect.
//! If a another version was already loaded previously, it won't unload it.
//! You have to call /sa unloadSimConnect() before.
bool loadAndResolveP3DSimConnect(P3DSimConnectVersion version);
FSXCOMMON_EXPORT bool loadAndResolveP3DSimConnect(P3DSimConnectVersion version);
//! Same but string version
inline bool loadAndResolveP3DSimConnectByString(const QString &version) { return loadAndResolveP3DSimConnect(stringToP3DVersion(version)); }
@@ -41,7 +43,7 @@ inline bool loadAndResolveP3DSimConnectByString(const QString &version) { return
//! Load and resolve FSX SimConnect.
//! \param manifestProbing Set to true if you want to try loading from the assembly cache with manifests.
//! Otherwise the library in the bin folder will be loaded.
bool loadAndResolveFsxSimConnect(bool manifestProbing);
FSXCOMMON_EXPORT bool loadAndResolveFsxSimConnect(bool manifestProbing);
#endif

View File

@@ -12,10 +12,11 @@
#ifndef BLACKSIMPLUGIN_FSXCOMMON_SIMULATORFSXCOMMON_H
#define BLACKSIMPLUGIN_FSXCOMMON_SIMULATORFSXCOMMON_H
#include "simconnectdatadefinition.h"
#include "simconnectobject.h"
#include "../fsxcommon/simconnectwindows.h"
#include "../fscommon/simulatorfscommon.h"
#include "plugins/simulator/fsxcommon/fsxcommonexport.h"
#include "plugins/simulator/fsxcommon/simconnectdatadefinition.h"
#include "plugins/simulator/fsxcommon/simconnectobject.h"
#include "plugins/simulator/fsxcommon/simconnectwindows.h"
#include "plugins/simulator/fscommon/simulatorfscommon.h"
#include "blackcore/simulator.h"
#include "blackmisc/simulation/interpolatorlinear.h"
#include "blackmisc/simulation/simulatorplugininfo.h"
@@ -115,7 +116,7 @@ namespace BlackSimPlugin
};
//! FSX Simulator Implementation
class CSimulatorFsxCommon : public FsCommon::CSimulatorFsCommon
class FSXCOMMON_EXPORT CSimulatorFsxCommon : public FsCommon::CSimulatorFsCommon
{
Q_OBJECT
Q_INTERFACES(BlackCore::ISimulator)
@@ -615,7 +616,7 @@ namespace BlackSimPlugin
};
//! Listener for FSX
class CSimulatorFsxCommonListener : public BlackCore::ISimulatorListener
class FSXCOMMON_EXPORT CSimulatorFsxCommonListener : public BlackCore::ISimulatorListener
{
Q_OBJECT

View File

@@ -12,6 +12,7 @@
#ifndef BLACKSIMPLUGIN_FSXCOMMON_SIMULATORFSXCONFIGWINDOW_H
#define BLACKSIMPLUGIN_FSXCOMMON_SIMULATORFSXCONFIGWINDOW_H
#include "plugins/simulator/fsxcommon/fsxcommonexport.h"
#include "blackgui/pluginconfigwindow.h"
#include "blackmisc/simulation/simulatorinfo.h"
#include <QScopedPointer>
@@ -24,7 +25,7 @@ namespace BlackSimPlugin
/**
* A window that lets user set up the FSX plugin.
*/
class CSimulatorFsxConfigWindow : public BlackGui::CPluginConfigWindow
class FSXCOMMON_EXPORT CSimulatorFsxConfigWindow : public BlackGui::CPluginConfigWindow
{
Q_OBJECT