mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Added a build flag for FSX specific code
FSX SimConnect code is build and linked only if enabled by the build configuration. refs #145
This commit is contained in:
@@ -26,4 +26,5 @@ BLACK_CONFIG += BlackSound
|
||||
BLACK_CONFIG += BlackSim
|
||||
BLACK_CONFIG += Samples
|
||||
BLACK_CONFIG += Unittests
|
||||
#BLACK_CONFIG += FSX
|
||||
#BLACK_CONFIG += Doxygen
|
||||
|
||||
@@ -21,7 +21,6 @@ isEmpty(EXTERNALDIR) {
|
||||
}
|
||||
|
||||
# Everything is fine. Add the include path
|
||||
message("Found externals: $$EXTERNALDIR")
|
||||
INCLUDEPATH *= $$EXTERNALDIR/include
|
||||
|
||||
# and the library path depending on the used compiler
|
||||
@@ -50,11 +49,9 @@ linux-g++ {
|
||||
GCC64 = $$system($$QMAKE_CXX -Q --help=target | grep m64)
|
||||
contains(GCC64,[enabled]) {
|
||||
LIBS *= -L$$EXTERNALDIR/linux64/lib
|
||||
message("64 bit")
|
||||
}
|
||||
else {
|
||||
LIBS *= -L$$EXTERNALDIR/linux32/lib
|
||||
message("32 bit")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,12 @@ blackgui {
|
||||
|
||||
blackcore {
|
||||
LIBS += -lblackcore -lvatlib
|
||||
|
||||
win32 {
|
||||
contains(BLACK_CONFIG, FSX) {
|
||||
LIBS += -lSimConnect
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
blacksound {
|
||||
|
||||
@@ -37,12 +37,15 @@ DEFINES += LOG_IN_FILE
|
||||
HEADERS += *.h
|
||||
SOURCES += *.cpp
|
||||
|
||||
HEADERS += $$PWD/fsx/*.h
|
||||
SOURCES += $$PWD/fsx/*.cpp
|
||||
|
||||
win32 {
|
||||
HEADERS += $$PWD/win/*.h
|
||||
SOURCES += $$PWD/win/*.cpp
|
||||
|
||||
contains(BLACK_CONFIG, FSX) {
|
||||
DEFINES += BLACK_WITH_FSX
|
||||
HEADERS += $$PWD/fsx/*.h
|
||||
SOURCES += $$PWD/fsx/*.cpp
|
||||
}
|
||||
}
|
||||
|
||||
win32:!win32-g++*: PRE_TARGETDEPS += ../../lib/blackmisc.lib ../../lib/blacksound.lib
|
||||
|
||||
@@ -34,6 +34,7 @@ namespace BlackCore
|
||||
|
||||
public:
|
||||
|
||||
//! \brief Settings type
|
||||
enum SettingsType
|
||||
{
|
||||
SettingsHotKeys,
|
||||
|
||||
@@ -5,7 +5,10 @@
|
||||
|
||||
#include "context_simulator_impl.h"
|
||||
#include "coreruntime.h"
|
||||
#include "fsx/simulator_fsx.h"
|
||||
|
||||
#ifdef BLACK_WITH_FSX
|
||||
#include "fsx/simulator_fsx.h"
|
||||
#endif
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
@@ -17,13 +20,17 @@ namespace BlackCore
|
||||
// Init this context
|
||||
CContextSimulator::CContextSimulator(QObject *parent) :
|
||||
IContextSimulator(parent),
|
||||
m_simulator(new BlackCore::FSX::CSimulatorFSX(this)),
|
||||
m_simulator(nullptr),
|
||||
m_updateTimer(nullptr),
|
||||
m_contextNetwork(nullptr)
|
||||
|
||||
{
|
||||
m_updateTimer = new QTimer(this);
|
||||
|
||||
#ifdef BLACK_WITH_FSX
|
||||
m_simulator = new BlackCore::FSX::CSimulatorFSX(this);
|
||||
connect(m_simulator, &ISimulator::connectionChanged, this, &CContextSimulator::setConnectionStatus);
|
||||
#endif
|
||||
|
||||
connect(m_updateTimer, &QTimer::timeout, this, &CContextSimulator::updateOwnAircraft);
|
||||
}
|
||||
|
||||
@@ -34,6 +41,9 @@ namespace BlackCore
|
||||
|
||||
bool CContextSimulator::isConnected() const
|
||||
{
|
||||
if (!m_simulator)
|
||||
return false;
|
||||
|
||||
return m_simulator->isConnected();
|
||||
}
|
||||
|
||||
@@ -44,6 +54,9 @@ namespace BlackCore
|
||||
|
||||
void CContextSimulator::updateOwnAircraft()
|
||||
{
|
||||
if (!m_simulator)
|
||||
return;
|
||||
|
||||
m_ownAircraft = m_simulator->getOwnAircraft();
|
||||
|
||||
if (!m_contextNetwork)
|
||||
|
||||
Reference in New Issue
Block a user