From 347b54171bc3a9fcbb7285809d4342d998f6a113 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Tue, 28 Feb 2017 04:29:58 +0100 Subject: [PATCH] refs #891, added dir / config for P3D plugin --- mkspecs/features/common_pre.prf | 4 ++-- mkspecs/features/config.pri | 3 +++ src/blackconfig/buildconfig.cpp | 5 ---- src/blackconfig/buildconfig.h | 32 +++++++++++++------------- src/blackconfig/buildconfig_gen.cpp.in | 10 ++++++++ src/plugins/simulator/simulator.pro | 10 ++++++-- 6 files changed, 39 insertions(+), 25 deletions(-) diff --git a/mkspecs/features/common_pre.prf b/mkspecs/features/common_pre.prf index 82a337383..b48818e4f 100644 --- a/mkspecs/features/common_pre.prf +++ b/mkspecs/features/common_pre.prf @@ -77,10 +77,10 @@ msvc:!llvm: QMAKE_CXXFLAGS *= /bigobj win32-g++: QMAKE_CXXFLAGS_DEBUG += -Og ################################ -# FSX or FS9 on 32bit Windows only +# FSX, P3D or FS9 on 32bit Windows only ################################ -equals(WORD_SIZE,64)|!win32: BLACK_CONFIG -= FSX FS9 +equals(WORD_SIZE,64)|!win32: BLACK_CONFIG -= FSX FS9 P3D ################################ # For BlackMisc::getStackTrace diff --git a/mkspecs/features/config.pri b/mkspecs/features/config.pri index 4e9c901dd..b47926d69 100644 --- a/mkspecs/features/config.pri +++ b/mkspecs/features/config.pri @@ -12,6 +12,7 @@ BLACK_CONFIG *= SwiftGui BLACK_CONFIG *= SwiftLauncher BLACK_CONFIG *= FS9 BLACK_CONFIG *= FSX +BLACK_CONFIG *= P3D BLACK_CONFIG *= XPlane BLACK_CONFIG *= ProfileRelease BLACK_CONFIG *= AssertsInRelease @@ -30,6 +31,7 @@ isEmpty(BLACK_EOL): BLACK_EOL = "20180101" include(vatsim.pri) # Header based compiler macros +# DEFINES correspond with buildconfig_gen.cpp.in !contains(BLACK_CONFIG, BlackSound) { DEFINE_WITH_BLACKSOUND = "//" } !contains(BLACK_CONFIG, BlackInput) { DEFINE_WITH_BLACKINPUT = "//" } !contains(BLACK_CONFIG, BlackCore) { DEFINE_WITH_BLACKCORE = "//" } @@ -37,6 +39,7 @@ include(vatsim.pri) !contains(BLACK_CONFIG, SwiftData) { DEFINE_WITH_SWIFTDATA = "//" } !contains(BLACK_CONFIG, SwiftGui) { DEFINE_WITH_SWIFTGUI = "//" } !contains(BLACK_CONFIG, SwiftCore) { DEFINE_WITH_SWIFTCORE = "//" } +!contains(BLACK_CONFIG, P3D) { DEFINE_WITH_P3D = "//" } !contains(BLACK_CONFIG, FSX) { DEFINE_WITH_FSX = "//" } !contains(BLACK_CONFIG, FS9) { DEFINE_WITH_FS9 = "//" } !contains(BLACK_CONFIG, XPlane) { DEFINE_WITH_XPLANE = "//" } diff --git a/src/blackconfig/buildconfig.cpp b/src/blackconfig/buildconfig.cpp index b6e974ba2..63ac2ac88 100644 --- a/src/blackconfig/buildconfig.cpp +++ b/src/blackconfig/buildconfig.cpp @@ -21,11 +21,6 @@ namespace BlackConfig { - bool CBuildConfig::isCompiledWithP3DSupport() - { - return CBuildConfig::isCompiledWithFsxSupport(); - } - bool CBuildConfig::isCompiledWithMsFlightSimulatorSupport() { return CBuildConfig::isCompiledWithFs9Support() || CBuildConfig::isCompiledWithFsxSupport() || CBuildConfig::isCompiledWithP3DSupport(); diff --git a/src/blackconfig/buildconfig.h b/src/blackconfig/buildconfig.h index ce77021ce..69501874b 100644 --- a/src/blackconfig/buildconfig.h +++ b/src/blackconfig/buildconfig.h @@ -25,34 +25,34 @@ namespace BlackConfig { public: //! with BlackCore? - static bool isCompiledWithBlackCore(); + static bool isCompiledWithBlackCore(); // defined in buildconfig_gen.cpp.in //! with BlackSound? - static bool isCompiledWithBlackSound(); + static bool isCompiledWithBlackSound(); // defined in buildconfig_gen.cpp.in //! with BlackInput? - static bool isCompiledWithBlackInput(); + static bool isCompiledWithBlackInput(); // defined in buildconfig_gen.cpp.in //! with FS9 support? - static bool isCompiledWithFs9Support(); + static bool isCompiledWithFs9Support(); // defined in buildconfig_gen.cpp.in //! with FSX support? - static bool isCompiledWithFsxSupport(); + static bool isCompiledWithFsxSupport(); // defined in buildconfig_gen.cpp.in - //! with P3D support - static bool isCompiledWithP3DSupport(); + //! with P3D support? + static bool isCompiledWithP3DSupport(); // defined in buildconfig_gen.cpp.in //! Compiled with any MS Flight Simulator support (P3D, FSX, FS9) static bool isCompiledWithMsFlightSimulatorSupport(); //! with XPlane support? - static bool isCompiledWithXPlaneSupport(); + static bool isCompiledWithXPlaneSupport(); // defined in buildconfig_gen.cpp.in //! with any simulator libraries static bool isCompiledWithFlightSimulatorSupport(); //! with GUI? - static bool isCompiledWithGui(); + static bool isCompiledWithGui(); // defined in buildconfig_gen.cpp.in //! Debug build? static bool isDebugBuild(); @@ -61,16 +61,16 @@ namespace BlackConfig static bool isReleaseBuild(); //! Beta test? - static bool isBetaTest(); + static bool isBetaTest(); // defined in buildconfig_gen.cpp.in //! Can run in dev. environment? static bool canRunInDeveloperEnvironment(); //! Shipped version? - static bool isShippedVersion(); + static bool isShippedVersion(); // defined in buildconfig_gen.cpp.in //! Vatsim enabled version? - static bool isVatsimVersion(); + static bool isVatsimVersion(); // defined in buildconfig_gen.cpp.in //! Running on Windows NT platform? static bool isRunningOnWindowsNtPlatform(); @@ -140,16 +140,16 @@ namespace BlackConfig static const QString &swiftDataExecutableName(); //! End of lifetime - static const QDateTime &getEol(); + static const QDateTime &getEol(); // defined in buildconfig_gen.cpp.in //! Lifetime ended? static bool isLifetimeExpired(); //! Vatsim client id - static int vatsimClientId(); + static int vatsimClientId(); // defined in buildconfig_gen.cpp.in //! Vatsim client key - static const QString &vatsimPrivateKey(); + static const QString &vatsimPrivateKey(); // defined in buildconfig_gen.cpp.in }; //! Version @@ -157,7 +157,7 @@ namespace BlackConfig { public: //! Version info - static const QString &version(); + static const QString &version(); // defined in buildconfig_gen.cpp.in //! Version major static int versionMajor(); diff --git a/src/blackconfig/buildconfig_gen.cpp.in b/src/blackconfig/buildconfig_gen.cpp.in index 2df4fe4eb..4031890b7 100644 --- a/src/blackconfig/buildconfig_gen.cpp.in +++ b/src/blackconfig/buildconfig_gen.cpp.in @@ -19,6 +19,7 @@ $$DEFINE_WITH_SWIFTDATA#define WITH_SWIFTDATA $$DEFINE_WITH_SWIFTGUI#define WITH_SWIFTGUI $$DEFINE_WITH_SWIFTCORE#define WITH_SWIFTCORE $$DEFINE_WITH_FSX#define WITH_FSX +$$DEFINE_WITH_P3D#define WITH_P3D $$DEFINE_WITH_FS9#define WITH_FS9 $$DEFINE_WITH_XPLANE#define WITH_XPLANE $$DEFINE_SWIFT_BETA#define SWIFT_BETA @@ -61,6 +62,15 @@ bool BlackConfig::CBuildConfig::isCompiledWithFs9Support() #endif } +bool BlackConfig::CBuildConfig::isCompiledWithP3DSupport() +{ +#ifdef WITH_P3D + return true; +#else + return false; +#endif +} + bool BlackConfig::CBuildConfig::isCompiledWithFsxSupport() { #ifdef WITH_FSX diff --git a/src/plugins/simulator/simulator.pro b/src/plugins/simulator/simulator.pro index 802374d2d..9ebb63a65 100644 --- a/src/plugins/simulator/simulator.pro +++ b/src/plugins/simulator/simulator.pro @@ -3,9 +3,16 @@ load(common_pre) TEMPLATE = subdirs CONFIG += ordered -contains(BLACK_CONFIG,FSX|FS9) { +contains(BLACK_CONFIG,FSX|FS9|P3D) { SUBDIRS += fscommon } +contains(BLACK_CONFIG,FSX|P3D) { + SUBDIRS += fsxcommon +} +contains(BLACK_CONFIG,P3D) { + SUBDIRS += p3d + SUBDIRS += p3dconfig +} contains(BLACK_CONFIG,FSX) { SUBDIRS += fsx SUBDIRS += fsxconfig @@ -17,5 +24,4 @@ contains(BLACK_CONFIG,XPlane) { SUBDIRS += xplane SUBDIRS += xplaneconfig } - load(common_post)