From d639187f91fde8f7a987977cf9df55a7104de7b9 Mon Sep 17 00:00:00 2001 From: Roland Rossgotterer Date: Mon, 17 Dec 2018 15:59:14 +0100 Subject: [PATCH] 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 --- externals | 2 +- installer/installbuilder/qt5-binaries.xml | 2 +- .../installbuilder/swift-pilotclient.xml | 13 ++++++++ mkspecs/features/libraries.pri | 8 ++--- src/plugins/simulator/emulated/emulated.pro | 4 +-- src/plugins/simulator/fs9/fs9.pro | 7 ++-- src/plugins/simulator/fscommon/fscommon.pro | 17 +++++++--- .../simulator/fscommon/fscommonexport.h | 32 +++++++++++++++++++ src/plugins/simulator/fscommon/fsuipc.h | 3 +- .../simulator/fscommon/simulatorfscommon.h | 6 ++-- src/plugins/simulator/fsx/fsx.pro | 2 +- src/plugins/simulator/fsxcommon/fsxcommon.pro | 18 +++++++---- .../simulator/fsxcommon/fsxcommonexport.h | 32 +++++++++++++++++++ .../fsxcommon/fsxsettingscomponent.h | 3 +- .../fsxcommon/simconnectdatadefinition.h | 13 ++++---- .../simulator/fsxcommon/simconnectobject.h | 5 +-- .../fsxcommon/simconnectsettingscomponent.h | 3 +- .../simulator/fsxcommon/simconnectsymbols.h | 8 +++-- .../simulator/fsxcommon/simulatorfsxcommon.h | 13 ++++---- .../fsxcommon/simulatorfsxconfigwindow.h | 3 +- src/plugins/simulator/fsxconfig/fsxconfig.pro | 2 +- src/plugins/simulator/p3d/p3d.pro | 2 +- src/plugins/simulator/p3dconfig/p3dconfig.pro | 2 +- .../simulator/plugincommon/plugincommon.pro | 15 +++++++-- .../plugincommon/simulatorplugincommon.h | 3 +- .../simulatorplugincommonexport.h | 32 +++++++++++++++++++ src/plugins/simulator/xplane/xplane.pro | 5 +-- .../testblacksimpluginfsxp3d.pro | 2 +- 28 files changed, 194 insertions(+), 63 deletions(-) create mode 100644 src/plugins/simulator/fscommon/fscommonexport.h create mode 100644 src/plugins/simulator/fsxcommon/fsxcommonexport.h create mode 100644 src/plugins/simulator/plugincommon/simulatorplugincommonexport.h diff --git a/externals b/externals index e65d53de6..0366a091f 160000 --- a/externals +++ b/externals @@ -1 +1 @@ -Subproject commit e65d53de6e09994dd5a9def75767d7e845975200 +Subproject commit 0366a091f217bd095e1f659751162038683067bb diff --git a/installer/installbuilder/qt5-binaries.xml b/installer/installbuilder/qt5-binaries.xml index c06b614a1..eeae7f62b 100644 --- a/installer/installbuilder/qt5-binaries.xml +++ b/installer/installbuilder/qt5-binaries.xml @@ -2,7 +2,7 @@ qt5binaries Qt5 binaries 1 - Qt 5.5 runtime binaries + Qt5 runtime binaries 1 1 diff --git a/installer/installbuilder/swift-pilotclient.xml b/installer/installbuilder/swift-pilotclient.xml index cc261c0f3..8557a700b 100644 --- a/installer/installbuilder/swift-pilotclient.xml +++ b/installer/installbuilder/swift-pilotclient.xml @@ -64,6 +64,15 @@ This installs the binaries to run all swift applications. ../../dist/bin/blackmisc.dll + + ../../dist/bin/simulatorplugincommon.dll + + + ../../dist/bin/simulatorfscommon.dll + + + ../../dist/bin/simulatorfsxcommon.dll + @@ -103,6 +112,10 @@ This installs the binaries to run all swift applications. 1 ../../dist/lib/libblacksound* + + 1 + ../../dist/lib/libsimulatorplugincommon* + diff --git a/mkspecs/features/libraries.pri b/mkspecs/features/libraries.pri index c381d89b8..d489569f6 100644 --- a/mkspecs/features/libraries.pri +++ b/mkspecs/features/libraries.pri @@ -7,17 +7,17 @@ unix:!macx { } simulatorfsxcommon { - addStaticLibraryDependency(simulatorfsxcommon) + addLibraryDependency(simulatorfsxcommon) LIBS += -lsimulatorfsxcommon } simulatorfscommon { - addStaticLibraryDependency(simulatorfscommon) + addLibraryDependency(simulatorfscommon) LIBS += -lsimulatorfscommon } simulatorplugincommon { - addStaticLibraryDependency(simulatorplugincommon) + addLibraryDependency(simulatorplugincommon) LIBS += -lsimulatorplugincommon } @@ -35,8 +35,6 @@ simconnect { equals(WORD_SIZE,32) { INCLUDEPATH *= $$EXTERNALSROOT/common/include/simconnect/FSX-XPack } - - RC_FILE = $$SourceRoot/src/plugins/simulator/fsxcommon/simconnect.rc } blackgui { diff --git a/src/plugins/simulator/emulated/emulated.pro b/src/plugins/simulator/emulated/emulated.pro index 1c8a09a52..e6cdb6b8f 100644 --- a/src/plugins/simulator/emulated/emulated.pro +++ b/src/plugins/simulator/emulated/emulated.pro @@ -7,6 +7,7 @@ TEMPLATE = lib CONFIG += plugin shared CONFIG += blackmisc blackcore blackgui +CONFIG += simulatorplugincommon DEPENDPATH += . $$SourceRoot/src INCLUDEPATH += . $$SourceRoot/src @@ -17,9 +18,6 @@ FORMS += *.ui DISTFILES += simulatoremulated.json DESTDIR = $$DestRoot/bin/plugins/simulator -LIBS *= -lsimulatorplugincommon -addStaticLibraryDependency(simulatorplugincommon) - win32 { dlltarget.path = $$PREFIX/bin/plugins/simulator INSTALLS += dlltarget diff --git a/src/plugins/simulator/fs9/fs9.pro b/src/plugins/simulator/fs9/fs9.pro index 32f72b040..ba6a8a157 100644 --- a/src/plugins/simulator/fs9/fs9.pro +++ b/src/plugins/simulator/fs9/fs9.pro @@ -7,15 +7,12 @@ TEMPLATE = lib CONFIG += plugin shared CONFIG += blackmisc blackcore blackgui +CONFIG += simulatorfscommon simulatorplugincommon DEPENDPATH += . $$SourceRoot/src INCLUDEPATH += . $$SourceRoot/src -addStaticLibraryDependency(simulatorplugincommon) -addStaticLibraryDependency(simulatorfscommon) -addStaticLibraryDependency(fsuipc) -LIBS += -lsimulatorfscommon -lfsuipc -luuid -lsimulatorplugincommon -LIBS += -ldxguid -lole32 +LIBS += -luuid -ldxguid -lole32 SOURCES += *.cpp HEADERS += *.h diff --git a/src/plugins/simulator/fscommon/fscommon.pro b/src/plugins/simulator/fscommon/fscommon.pro index ce87e9444..6e68e7888 100644 --- a/src/plugins/simulator/fscommon/fscommon.pro +++ b/src/plugins/simulator/fscommon/fscommon.pro @@ -1,12 +1,16 @@ load(common_pre) -QT += core dbus network +QT += core dbus network widgets TARGET = simulatorfscommon TEMPLATE = lib -CONFIG += staticlib -CONFIG += blackconfig blackmisc +CONFIG += blackconfig blackmisc blackcore blackgui +CONFIG += simulatorplugincommon fsuipc + +contains(BLACK_CONFIG, Static) { + CONFIG += staticlib +} DEPENDPATH += . $$SourceRoot/src INCLUDEPATH += . $$SourceRoot/src @@ -14,8 +18,7 @@ INCLUDEPATH += . $$SourceRoot/src SOURCES += *.cpp HEADERS += *.h -LIBS *= -lsimulatorplugincommon -addStaticLibraryDependency(simulatorplugincommon) +DEFINES += BUILD_FSCOMMON_LIB swiftConfig(sims.fsuipc) { equals(WORD_SIZE,32) { @@ -27,5 +30,9 @@ swiftConfig(sims.fsuipc) { } DESTDIR = $$DestRoot/lib +DLLDESTDIR = $$DestRoot/bin + +dlltarget.path = $$PREFIX/bin +INSTALLS += dlltarget load(common_post) diff --git a/src/plugins/simulator/fscommon/fscommonexport.h b/src/plugins/simulator/fscommon/fscommonexport.h new file mode 100644 index 000000000..413c90d03 --- /dev/null +++ b/src/plugins/simulator/fscommon/fscommonexport.h @@ -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_FSCOMMON_SIMULATORFSCOMMON_MACROS_H +#define BLACKSIMPLUGIN_FSCOMMON_SIMULATORFSCOMMON_MACROS_H + +#include + +/*! + * \def FSCOMMON_EXPORT + * FSCommon Export Macro + */ + +#ifndef WITH_STATIC +# if defined(BUILD_FSCOMMON_LIB) +# define FSCOMMON_EXPORT Q_DECL_EXPORT +# else +# define FSCOMMON_EXPORT Q_DECL_IMPORT +# endif +#else +# define FSCOMMON_EXPORT +#endif + +#endif // guard diff --git a/src/plugins/simulator/fscommon/fsuipc.h b/src/plugins/simulator/fscommon/fsuipc.h index 5f3cd233a..00ec40e8e 100644 --- a/src/plugins/simulator/fscommon/fsuipc.h +++ b/src/plugins/simulator/fscommon/fsuipc.h @@ -12,6 +12,7 @@ #ifndef BLACKSIMPLUGIN_FSUIPC_H #define BLACKSIMPLUGIN_FSUIPC_H +#include "plugins/simulator/fscommon/fscommonexport.h" #include "blackmisc/simulation/simulatedaircraft.h" #include "blackmisc/weather/weathergrid.h" #include @@ -21,7 +22,7 @@ namespace BlackSimPlugin namespace FsCommon { //! Class representing a FSUIPC "interface" - class CFsuipc : public QObject + class FSCOMMON_EXPORT CFsuipc : public QObject { Q_OBJECT diff --git a/src/plugins/simulator/fscommon/simulatorfscommon.h b/src/plugins/simulator/fscommon/simulatorfscommon.h index 30f233cd2..eb70f5994 100644 --- a/src/plugins/simulator/fscommon/simulatorfscommon.h +++ b/src/plugins/simulator/fscommon/simulatorfscommon.h @@ -12,10 +12,10 @@ #ifndef BLACKSIMPLUGIN_FSCOMMON_SIMULATORFSCOMMON_H #define BLACKSIMPLUGIN_FSCOMMON_SIMULATORFSCOMMON_H -#include "../plugincommon/simulatorplugincommon.h" +#include "plugins/simulator/fscommon/fsuipc.h" +#include "plugins/simulator/plugincommon/simulatorplugincommon.h" #include "blackmisc/simulation/interpolator.h" #include "blackmisc/simulation/fscommon/aircraftcfgparser.h" -#include "fsuipc.h" #include #include @@ -25,7 +25,7 @@ namespace BlackSimPlugin namespace FsCommon { //! Common base class for MS flight simulators - class CSimulatorFsCommon : public Common::CSimulatorPluginCommon + class FSCOMMON_EXPORT CSimulatorFsCommon : public Common::CSimulatorPluginCommon { Q_OBJECT Q_INTERFACES(BlackCore::ISimulator) diff --git a/src/plugins/simulator/fsx/fsx.pro b/src/plugins/simulator/fsx/fsx.pro index d56f7e009..edadab734 100644 --- a/src/plugins/simulator/fsx/fsx.pro +++ b/src/plugins/simulator/fsx/fsx.pro @@ -6,7 +6,7 @@ TEMPLATE = lib CONFIG += plugin shared CONFIG += blackconfig blackmisc blackcore blackgui -CONFIG += simulatorfsxcommon simulatorfscommon simulatorplugincommon fsuipc simconnect +CONFIG += simulatorfsxcommon simulatorfscommon simulatorplugincommon simconnect DEPENDPATH += . $$SourceRoot/src INCLUDEPATH += . $$SourceRoot/src diff --git a/src/plugins/simulator/fsxcommon/fsxcommon.pro b/src/plugins/simulator/fsxcommon/fsxcommon.pro index 26dde0ebe..f6c6293ca 100644 --- a/src/plugins/simulator/fsxcommon/fsxcommon.pro +++ b/src/plugins/simulator/fsxcommon/fsxcommon.pro @@ -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) diff --git a/src/plugins/simulator/fsxcommon/fsxcommonexport.h b/src/plugins/simulator/fsxcommon/fsxcommonexport.h new file mode 100644 index 000000000..0b308db28 --- /dev/null +++ b/src/plugins/simulator/fsxcommon/fsxcommonexport.h @@ -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 + +/*! + * \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 diff --git a/src/plugins/simulator/fsxcommon/fsxsettingscomponent.h b/src/plugins/simulator/fsxcommon/fsxsettingscomponent.h index 078c189f5..34673024e 100644 --- a/src/plugins/simulator/fsxcommon/fsxsettingscomponent.h +++ b/src/plugins/simulator/fsxcommon/fsxsettingscomponent.h @@ -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 @@ -26,7 +27,7 @@ namespace BlackSimPlugin class CSimulatorFsxCommon; //! FSX/P3D settings - class CFsxSettingsComponent : public QFrame + class FSXCOMMON_EXPORT CFsxSettingsComponent : public QFrame { Q_OBJECT diff --git a/src/plugins/simulator/fsxcommon/simconnectdatadefinition.h b/src/plugins/simulator/fsxcommon/simconnectdatadefinition.h index c784fd382..2520ecedb 100644 --- a/src/plugins/simulator/fsxcommon/simconnectdatadefinition.h +++ b/src/plugins/simulator/fsxcommon/simconnectdatadefinition.h @@ -12,11 +12,12 @@ #ifndef BLACKSIMPLUGIN_FSXCOMMON_SIMCONNECT_DATADEFINITION_H #define BLACKSIMPLUGIN_FSXCOMMON_SIMCONNECT_DATADEFINITION_H -#include - +#include "plugins/simulator/fsxcommon/fsxcommonexport.h" +#include "plugins/simulator/fsxcommon/simconnectwindows.h" #include "blackmisc/aviation/aircraftlights.h" -#include "../fsxcommon/simconnectwindows.h" + #include +#include #include 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 diff --git a/src/plugins/simulator/fsxcommon/simconnectobject.h b/src/plugins/simulator/fsxcommon/simconnectobject.h index d83effc03..2ad50978d 100644 --- a/src/plugins/simulator/fsxcommon/simconnectobject.h +++ b/src/plugins/simulator/fsxcommon/simconnectobject.h @@ -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 @@ -24,7 +25,7 @@ namespace BlackSimPlugin namespace FsxCommon { //! Class representing a SimConnect object - class CSimConnectObject + class FSXCOMMON_EXPORT CSimConnectObject { public: //! Type diff --git a/src/plugins/simulator/fsxcommon/simconnectsettingscomponent.h b/src/plugins/simulator/fsxcommon/simconnectsettingscomponent.h index 099a37554..27ff6ba02 100644 --- a/src/plugins/simulator/fsxcommon/simconnectsettingscomponent.h +++ b/src/plugins/simulator/fsxcommon/simconnectsettingscomponent.h @@ -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 diff --git a/src/plugins/simulator/fsxcommon/simconnectsymbols.h b/src/plugins/simulator/fsxcommon/simconnectsymbols.h index 4850f97da..70e7294cc 100644 --- a/src/plugins/simulator/fsxcommon/simconnectsymbols.h +++ b/src/plugins/simulator/fsxcommon/simconnectsymbols.h @@ -12,6 +12,8 @@ #ifndef BLACKSIMPLUGIN_FSXCOMMON_SIMCONNECTSYMBOLS_H #define BLACKSIMPLUGIN_FSXCOMMON_SIMCONNECTSYMBOLS_H +#include "plugins/simulator/fsxcommon/fsxcommonexport.h" + #include #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 diff --git a/src/plugins/simulator/fsxcommon/simulatorfsxcommon.h b/src/plugins/simulator/fsxcommon/simulatorfsxcommon.h index def41b8f1..ab0890800 100644 --- a/src/plugins/simulator/fsxcommon/simulatorfsxcommon.h +++ b/src/plugins/simulator/fsxcommon/simulatorfsxcommon.h @@ -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 diff --git a/src/plugins/simulator/fsxcommon/simulatorfsxconfigwindow.h b/src/plugins/simulator/fsxcommon/simulatorfsxconfigwindow.h index 8a25a63ca..2ba7bded5 100644 --- a/src/plugins/simulator/fsxcommon/simulatorfsxconfigwindow.h +++ b/src/plugins/simulator/fsxcommon/simulatorfsxconfigwindow.h @@ -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 @@ -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 diff --git a/src/plugins/simulator/fsxconfig/fsxconfig.pro b/src/plugins/simulator/fsxconfig/fsxconfig.pro index 9376358d4..e31edfce3 100644 --- a/src/plugins/simulator/fsxconfig/fsxconfig.pro +++ b/src/plugins/simulator/fsxconfig/fsxconfig.pro @@ -6,7 +6,7 @@ TEMPLATE = lib CONFIG += plugin shared CONFIG += blackconfig blackmisc blackcore blackgui -CONFIG += simulatorfsxcommon simulatorfscommon simulatorplugincommon fsuipc simconnect +CONFIG += simulatorfsxcommon DEPENDPATH += . $$SourceRoot/src INCLUDEPATH += . $$SourceRoot/src diff --git a/src/plugins/simulator/p3d/p3d.pro b/src/plugins/simulator/p3d/p3d.pro index ec517eb77..bb8398ab3 100644 --- a/src/plugins/simulator/p3d/p3d.pro +++ b/src/plugins/simulator/p3d/p3d.pro @@ -11,7 +11,7 @@ TEMPLATE = lib CONFIG += plugin shared CONFIG += blackconfig blackmisc blackcore blackgui -CONFIG += simulatorfsxcommon simulatorfscommon simulatorplugincommon fsuipc simconnect +CONFIG += simulatorfsxcommon simulatorfscommon simulatorplugincommon simconnect DEPENDPATH += . $$SourceRoot/src INCLUDEPATH += . $$SourceRoot/src diff --git a/src/plugins/simulator/p3dconfig/p3dconfig.pro b/src/plugins/simulator/p3dconfig/p3dconfig.pro index 928ef5fd1..c962dfe95 100644 --- a/src/plugins/simulator/p3dconfig/p3dconfig.pro +++ b/src/plugins/simulator/p3dconfig/p3dconfig.pro @@ -6,7 +6,7 @@ TEMPLATE = lib CONFIG += plugin shared CONFIG += blackconfig blackmisc blackcore blackgui -CONFIG += simulatorfsxcommon simulatorfscommon simulatorplugincommon fsuipc simconnect +CONFIG += simulatorfsxcommon DEPENDPATH += . $$SourceRoot/src INCLUDEPATH += . $$SourceRoot/src diff --git a/src/plugins/simulator/plugincommon/plugincommon.pro b/src/plugins/simulator/plugincommon/plugincommon.pro index 26309645c..3c89d3a62 100644 --- a/src/plugins/simulator/plugincommon/plugincommon.pro +++ b/src/plugins/simulator/plugincommon/plugincommon.pro @@ -5,14 +5,25 @@ QT += core dbus xml network widgets TARGET = simulatorplugincommon TEMPLATE = lib -CONFIG += staticlib -CONFIG += blackconfig blackmisc blackgui +CONFIG += blackconfig blackmisc blackcore blackgui DEPENDPATH += . $$SourceRoot/src INCLUDEPATH += . $$SourceRoot/src +DEFINES += BUILD_SIMULATORPLUGINCOMMON_LIB + SOURCES += *.cpp HEADERS += *.h + DESTDIR = $$DestRoot/lib +DLLDESTDIR = $$DestRoot/bin + +win32 { + dlltarget.path = $$PREFIX/bin + INSTALLS += dlltarget +} else { + target.path = $$PREFIX/lib + INSTALLS += target +} load(common_post) diff --git a/src/plugins/simulator/plugincommon/simulatorplugincommon.h b/src/plugins/simulator/plugincommon/simulatorplugincommon.h index b1b679651..48b690510 100644 --- a/src/plugins/simulator/plugincommon/simulatorplugincommon.h +++ b/src/plugins/simulator/plugincommon/simulatorplugincommon.h @@ -12,6 +12,7 @@ #ifndef BLACKSIMPLUGIN_COMMON_SIMULATORPLUGINCOMMON_H #define BLACKSIMPLUGIN_COMMON_SIMULATORPLUGINCOMMON_H +#include "plugins/simulator/plugincommon/simulatorplugincommonexport.h" #include "blackcore/simulator.h" #include #include @@ -22,7 +23,7 @@ namespace BlackSimPlugin namespace Common { //! Common base class for simulator plugins - class CSimulatorPluginCommon : public BlackCore::ISimulator + class SIMULATORPLUGINCOMMON_EXPORT CSimulatorPluginCommon : public BlackCore::ISimulator { Q_OBJECT Q_INTERFACES(BlackCore::ISimulator) diff --git a/src/plugins/simulator/plugincommon/simulatorplugincommonexport.h b/src/plugins/simulator/plugincommon/simulatorplugincommonexport.h new file mode 100644 index 000000000..52a0901ee --- /dev/null +++ b/src/plugins/simulator/plugincommon/simulatorplugincommonexport.h @@ -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_SIMULATORPLUGINCOMMON_MACROS_H +#define BLACKSIMPLUGIN_SIMULATORPLUGINCOMMON_MACROS_H + +#include + +/*! + * \def SIMULATORPLUGINCOMMON_EXPORT + * SimulatorPluginCommon Export Macro + */ + +#ifndef WITH_STATIC +# if defined(BUILD_SIMULATORPLUGINCOMMON_LIB) +# define SIMULATORPLUGINCOMMON_EXPORT Q_DECL_EXPORT +# else +# define SIMULATORPLUGINCOMMON_EXPORT Q_DECL_IMPORT +# endif +#else +# define SIMULATORPLUGINCOMMON_EXPORT +#endif + +#endif // guard diff --git a/src/plugins/simulator/xplane/xplane.pro b/src/plugins/simulator/xplane/xplane.pro index 1865e635f..8232d2092 100644 --- a/src/plugins/simulator/xplane/xplane.pro +++ b/src/plugins/simulator/xplane/xplane.pro @@ -6,7 +6,7 @@ TARGET = simulatorxplane TEMPLATE = lib CONFIG += plugin shared -CONFIG += blackmisc blackcore blackgui blackconfig +CONFIG += blackmisc blackcore blackgui blackconfig simulatorplugincommon DEPENDPATH += . $$SourceRoot/src INCLUDEPATH += . $$SourceRoot/src @@ -21,9 +21,6 @@ HEADERS += *.h DISTFILES += simulatorxplane.json DESTDIR = $$DestRoot/bin/plugins/simulator -LIBS *= -lsimulatorplugincommon -addStaticLibraryDependency(simulatorplugincommon) - win32 { dlltarget.path = $$PREFIX/bin/plugins/simulator INSTALLS += dlltarget diff --git a/tests/blacksimpluginfsxp3d/testblacksimpluginfsxp3d.pro b/tests/blacksimpluginfsxp3d/testblacksimpluginfsxp3d.pro index 20db5d6a8..b9420676d 100644 --- a/tests/blacksimpluginfsxp3d/testblacksimpluginfsxp3d.pro +++ b/tests/blacksimpluginfsxp3d/testblacksimpluginfsxp3d.pro @@ -5,7 +5,7 @@ QT += core testlib dbus network gui widgets TARGET = testblacksimpluginfsxp3d CONFIG -= app_bundle CONFIG += blackmisc blackcore blackconfig blackgui -CONFIG += simulatorfsxcommon simulatorfscommon simulatorplugincommon fsuipc simconnect +CONFIG += simulatorfsxcommon simulatorfscommon simulatorplugincommon simconnect CONFIG += testcase CONFIG += no_testcase_installs