mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
Replace qmake variable BLACK_CONFIG with a system based on json files.
The config is loaded from json files by qmake, and we define the qmake function `swiftConfig` for checking whether a feature is enabled. This function can be directly used in `buildconfig_gen.cpp.in`, so the trick with C++ comment tokens in variables is not needed.
This commit is contained in:
16
Jenkinsfile
vendored
16
Jenkinsfile
vendored
@@ -15,8 +15,8 @@ builders['Build swift Linux'] = {
|
||||
def eolInMonth = 6
|
||||
withEnv(['BITROCK_BUILDER=/opt/installbuilder/bin/builder', 'BITROCK_CUSTOMIZE=/opt/installbuilder/autoupdate/bin/customize.run']) {
|
||||
sh '''
|
||||
cp ~/vatsim.pri.official mkspecs/features/vatsim.pri
|
||||
python3 -u scripts/jenkins.py -w 64 -t gcc -d -j 2 -e ''' + getEolInMonth() + '''
|
||||
cp ~/vatsim.json .
|
||||
python3 -u scripts/jenkins.py -w 64 -t gcc -d -j 2 -e ''' + getEolInMonth() + ''' -q SWIFT_CONFIG_JSON+=vatsim.json
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -62,8 +62,8 @@ builders['Build swift MacOS'] = {
|
||||
stage('MacOS Build') {
|
||||
withEnv(['PATH+LOCAL=/usr/local/bin', 'BITROCK_BUILDER=/Applications/BitRockInstallBuilderQt/bin/builder', 'BITROCK_CUSTOMIZE=/Applications/BitRockInstallBuilderQt/autoupdate/bin/customize.sh']) {
|
||||
sh '''
|
||||
cp ~/vatsim.pri.official mkspecs/features/vatsim.pri
|
||||
python -u scripts/jenkins.py -w 64 -t clang -d -j2 -e ''' + getEolInMonth() + '''
|
||||
cp ~/vatsim.json .
|
||||
python -u scripts/jenkins.py -w 64 -t clang -d -j2 -e ''' + getEolInMonth() + ''' -q SWIFT_CONFIG_JSON+=vatsim.json
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -101,8 +101,8 @@ builders['Build swift Win32'] = {
|
||||
|
||||
stage('Win32 Build') {
|
||||
bat '''
|
||||
copy /Y c:\\var\\vatsim.pri.official mkspecs\\features\\vatsim.pri
|
||||
python -u scripts/jenkins.py -w 32 -t msvc -d -e ''' + getEolInMonth() + '''
|
||||
copy c:\\var\\vatsim.json .
|
||||
python -u scripts/jenkins.py -w 32 -t msvc -d -e ''' + getEolInMonth() + ''' -q SWIFT_CONFIG_JSON+=vatsim.json
|
||||
'''
|
||||
|
||||
warnings consoleParsers: [[parserName: 'MSBuild']], unstableTotalAll: '0'
|
||||
@@ -140,8 +140,8 @@ builders['Build swift Win64'] = {
|
||||
|
||||
stage('Win64 Build') {
|
||||
bat '''
|
||||
copy /Y c:\\var\\vatsim.pri.official mkspecs\\features\\vatsim.pri
|
||||
python -u scripts/jenkins.py -w 64 -t msvc -d -e ''' + getEolInMonth() + '''
|
||||
copy c:\\var\\vatsim.json .
|
||||
python -u scripts/jenkins.py -w 64 -t msvc -d -e ''' + getEolInMonth() + ''' -q SWIFT_CONFIG_JSON+=vatsim.json
|
||||
'''
|
||||
|
||||
warnings consoleParsers: [[parserName: 'MSBuild']], unstableTotalAll: '0'
|
||||
|
||||
37
default.json
Normal file
37
default.json
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"libs": {
|
||||
"blackcore": true,
|
||||
"blackgui": true,
|
||||
"blacksound": true,
|
||||
"blackinput": true
|
||||
},
|
||||
"samples": true,
|
||||
"unitTests": true,
|
||||
"apps": {
|
||||
"swiftdata": true,
|
||||
"swiftcore": true,
|
||||
"swiftgui": true,
|
||||
"swiftlauncher": true
|
||||
},
|
||||
"sims": {
|
||||
"fs9": true,
|
||||
"fsx": true,
|
||||
"p3d": true,
|
||||
"fsuipc": true,
|
||||
"xplane": true
|
||||
},
|
||||
"profileRelease": true,
|
||||
"assertsInRelease": true,
|
||||
"allowNoisyWarnings": false,
|
||||
"packageInstaller": true,
|
||||
"static": false,
|
||||
"doxygen": true,
|
||||
"devBranch": false,
|
||||
"stableBranch": false,
|
||||
"endOfLife": "20190601",
|
||||
"vatsimSupport": true,
|
||||
"vatsim": {
|
||||
"id": "0xb9ba",
|
||||
"key": "727d1efd5cb9f8d2c28372469d922bb4"
|
||||
}
|
||||
}
|
||||
@@ -57,7 +57,7 @@ contains(TEMPLATE, "vc.*"): QMAKE_CXXFLAGS *= /MP
|
||||
# Profile build
|
||||
################################
|
||||
|
||||
contains(BLACK_CONFIG, ProfileRelease) {
|
||||
swiftConfig(profileRelease) {
|
||||
msvc {
|
||||
QMAKE_CXXFLAGS_RELEASE *= /Zi
|
||||
QMAKE_LFLAGS_RELEASE *= /DEBUG /PROFILE /INCREMENTAL:NO /OPT:REF /OPT:ICF
|
||||
@@ -90,9 +90,9 @@ win32-g++: QMAKE_CXXFLAGS *= -Wa,-mbig-obj
|
||||
# FSX or FS9 on 32bit Windows only
|
||||
################################
|
||||
|
||||
!win32: BLACK_CONFIG -= P3D
|
||||
equals(WORD_SIZE,64)|!win32: BLACK_CONFIG -= FSX FS9
|
||||
# equals(WORD_SIZE,64):win32-g++: BLACK_CONFIG -= P3D
|
||||
!win32: disableSwiftConfig(sims.p3d)
|
||||
equals(WORD_SIZE,64)|!win32: disableSwiftConfig(sims.fsx, sims.fs9)
|
||||
# equals(WORD_SIZE,64):win32-g++: disableSwiftConfig(sims.p3d)
|
||||
|
||||
################################
|
||||
# For BlackMisc::getStackTrace
|
||||
@@ -163,7 +163,7 @@ defineTest(addStaticLibraryDependency) {
|
||||
export(PRE_TARGETDEPS)
|
||||
}
|
||||
defineTest(addLibraryDependency) {
|
||||
contains(BLACK_CONFIG, Static) {
|
||||
swiftConfig(static) {
|
||||
addStaticLibraryDependency($$1)
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -1,63 +1,120 @@
|
||||
## Public Area ##
|
||||
# Make sure _QMAKE_CACHE_ is initialized (otherwise config.log goes to the root directory)
|
||||
cache()
|
||||
|
||||
BLACK_CONFIG *= BlackCore
|
||||
BLACK_CONFIG *= BlackGui
|
||||
BLACK_CONFIG *= BlackSound
|
||||
BLACK_CONFIG *= BlackInput
|
||||
BLACK_CONFIG *= Samples
|
||||
BLACK_CONFIG *= Unittests
|
||||
BLACK_CONFIG *= SwiftData
|
||||
BLACK_CONFIG *= SwiftCore
|
||||
BLACK_CONFIG *= SwiftGui
|
||||
BLACK_CONFIG *= SwiftLauncher
|
||||
BLACK_CONFIG *= FS9
|
||||
BLACK_CONFIG *= FSX
|
||||
BLACK_CONFIG *= P3D
|
||||
BLACK_CONFIG *= XPlane
|
||||
BLACK_CONFIG *= ProfileRelease
|
||||
BLACK_CONFIG *= AssertsInRelease
|
||||
#BLACK_CONFIG *= AllowNoisyWarnings
|
||||
BLACK_CONFIG *= PackageInstaller
|
||||
#BLACK_CONFIG *= Static
|
||||
BLACK_CONFIG *= Doxygen
|
||||
#BLACK_CONFIG *= SwiftDevBranch
|
||||
#BLACK_CONFIG *= SwiftStableBranch
|
||||
BLACK_CONFIG *= FSUIPC
|
||||
################################
|
||||
# Parse json config files
|
||||
################################
|
||||
|
||||
isEmpty(BLACK_EOL): BLACK_EOL = "20190601"
|
||||
# Copy json keys/values from one variable prefix to another, optionally caching the result
|
||||
defineTest(copyJsonFromTo) {
|
||||
from = $$1
|
||||
to = $$2
|
||||
options = $$3
|
||||
|
||||
## Private Area ##
|
||||
unset($${to}._KEYS_)
|
||||
for(key, $${from}._KEYS_) {
|
||||
$${to}._KEYS_ += $$key
|
||||
export($${to}._KEYS_)
|
||||
copyJsonFromTo($${from}.$$key, $${to}.$$key, $$options)
|
||||
}
|
||||
contains(options, cache):defined($${to}._KEYS_, var): cache($${to}._KEYS_)
|
||||
|
||||
defined($$from, var) {
|
||||
contains(options, overwrite)|!defined($$to, var) {
|
||||
eval(newValue = \$\${$$from})
|
||||
$$to = $$newValue
|
||||
export($$to)
|
||||
}
|
||||
contains(options, cache):defined($$to, var): cache($$to)
|
||||
}
|
||||
}
|
||||
|
||||
# Options that control how the config works
|
||||
!swiftNoDefaultJson: SWIFT_CONFIG_JSON = default.json $$SWIFT_CONFIG_JSON
|
||||
equals(_PRO_FILE_PWD_, $$SourceRoot): CONFIG *= swiftNoCacheConfig
|
||||
|
||||
# Parse the json files (or get the values from the cache)
|
||||
for(jsonFile, SWIFT_CONFIG_JSON) {
|
||||
contains(jsonFile, [^A-Za-z0-9_\\.]): error(Illegal character in filename \"$$jsonFile\")
|
||||
jsonPath = $$SourceRoot/$$jsonFile
|
||||
!exists($$jsonPath): error($$jsonPath not found)
|
||||
SWIFT_CONFIG_JSON_PATHS += $$jsonPath
|
||||
export(SWIFT_CONFIG_JSON_PATHS)
|
||||
swiftNoCacheConfig {
|
||||
message(Parsing $${jsonFile}...)
|
||||
jsonBlob = $$cat($$jsonPath, blob)
|
||||
parseJson(jsonBlob, SWIFT_CONFIG_PARSED.$$jsonFile)
|
||||
copyJsonFromTo(SWIFT_CONFIG_PARSED.$$jsonFile, SWIFT_CONFIG_PARSED_ALL, overwrite)
|
||||
}
|
||||
}
|
||||
swiftNoCacheConfig {
|
||||
copyJsonFromTo(SWIFT_CONFIG_PARSED_ALL, SWIFT_CONFIG)
|
||||
copyJsonFromTo(SWIFT_CONFIG, SWIFT_CONFIG_CACHE, cache overwrite)
|
||||
}
|
||||
else {
|
||||
copyJsonFromTo(SWIFT_CONFIG_CACHE, SWIFT_CONFIG)
|
||||
}
|
||||
|
||||
# Automatically run qmake again when a json file changed
|
||||
QMAKE_INTERNAL_INCLUDED_FILES *= $$SWIFT_CONFIG_JSON_PATHS
|
||||
|
||||
# The line above doesn't work with Qt Creator's MSVC kit, so we report an error as a fallback
|
||||
load(touch)
|
||||
system($$TOUCH $$system_path($$BuildRoot/swift_config.cookie)) {
|
||||
swift_config_changed.target = $$shell_path($$BuildRoot/swift_config.cookie)
|
||||
swift_config_changed.depends = $$shell_path($$SWIFT_CONFIG_JSON_PATHS)
|
||||
swift_config_changed.commands = @echo ERROR: swift config changed, please run qmake again >&2 && exit 1
|
||||
QMAKE_EXTRA_TARGETS += swift_config_changed
|
||||
PRE_TARGETDEPS += $${swift_config_changed.target}
|
||||
}
|
||||
else:msvc {
|
||||
warning(Failed to create swift_config.cookie, you will need to manually run qmake again after any changes in $$join(SWIFT_CONFIG_JSON, ", ").)
|
||||
}
|
||||
|
||||
################################
|
||||
# Functions to read json config
|
||||
################################
|
||||
|
||||
defineTest(swiftConfig) {
|
||||
equals(SWIFT_CONFIG.$$1, true): return(true)
|
||||
return(false)
|
||||
}
|
||||
defineReplace(swiftConfig) {
|
||||
eval(value = \$\${SWIFT_CONFIG.$$1})
|
||||
return($$value)
|
||||
}
|
||||
|
||||
################################
|
||||
# Functions to modify json config
|
||||
################################
|
||||
|
||||
defineTest(setSwiftConfig) {
|
||||
SWIFT_CONFIG.$$1 = $$2
|
||||
export(SWIFT_CONFIG.$$1)
|
||||
}
|
||||
defineTest(enableSwiftConfig) {
|
||||
for(arg, ARGS): setSwiftConfig($$arg, true)
|
||||
}
|
||||
defineTest(disableSwiftConfig) {
|
||||
for(arg, ARGS): setSwiftConfig($$arg, false)
|
||||
}
|
||||
|
||||
################################
|
||||
# Functions for checking dependencies
|
||||
################################
|
||||
|
||||
## Dependency Checks ##
|
||||
load(configure)
|
||||
|
||||
defineTest(CheckMandatoryDependency) {
|
||||
!qtCompileTest($${1}): error(Cannot find $${1} development package. Make sure it is installed. Inspect config.log for more information.)
|
||||
}
|
||||
|
||||
defineTest(CheckOptionalDependency) {
|
||||
qtCompileTest($${1})
|
||||
}
|
||||
|
||||
# include vatsim client id and key
|
||||
include(vatsim.pri)
|
||||
################################
|
||||
# Global compiler macros
|
||||
################################
|
||||
|
||||
# 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 = "//" }
|
||||
!contains(BLACK_CONFIG, BlackGui) { DEFINE_WITH_BLACKGUI = "//" }
|
||||
!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, FSUIPC) { DEFINE_WITH_FSUIPC = "//" }
|
||||
!contains(BLACK_CONFIG, XPlane) { DEFINE_WITH_XPLANE = "//" }
|
||||
!contains(BLACK_CONFIG, SwiftVatsimSupport) { DEFINE_SWIFT_VATSIM_SUPPORT = "//" }
|
||||
|
||||
# Global compiler Macros
|
||||
contains(BLACK_CONFIG, Static) { DEFINES *= WITH_STATIC }
|
||||
contains(BLACK_CONFIG, AssertsInRelease) { DEFINES *= QT_FORCE_ASSERTS }
|
||||
swiftConfig(static) { DEFINES *= WITH_STATIC }
|
||||
swiftConfig(assertsInRelease) { DEFINES *= QT_FORCE_ASSERTS }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
contains(BLACK_CONFIG, Templight) {
|
||||
swiftConfig(templight) {
|
||||
QMAKE_CXXFLAGS += -Xtemplight -profiler -Xtemplight -ignore-system
|
||||
QMAKE_CXXFLAGS += -Xtemplight -blacklist -Xtemplight $$PWD/templight_blacklist
|
||||
clang_cl {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
win32:isEmpty(MINGW_IN_SHELL) {
|
||||
TOUCH = copy /y nul
|
||||
TOUCH = copy /y nul >nul
|
||||
}
|
||||
else {
|
||||
TOUCH = touch
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
# This is in a separate file to allow easy patching.
|
||||
|
||||
# VATSIM client id as assigned by VATSIM Network team. The one below is a test key.
|
||||
# It is working only with VATGER test server.
|
||||
isEmpty(VATSIM_CLIENT_ID):VATSIM_CLIENT_ID = "0xb9ba"
|
||||
|
||||
# VATSIM private key, which belongs to the id above.
|
||||
isEmpty(VATSIM_CLIENT_PRIVATE_KEY):VATSIM_CLIENT_PRIVATE_KEY = "727d1efd5cb9f8d2c28372469d922bb4"
|
||||
|
||||
# Comment the section below to build a version without VATSIM features enabled
|
||||
BLACK_CONFIG *= SwiftVatsimSupport
|
||||
@@ -7,7 +7,7 @@ gcc:QMAKE_CXXFLAGS_WARN_ON *= -Woverloaded-virtual
|
||||
gcc:QMAKE_CXXFLAGS_USE_PRECOMPILE = -Winvalid-pch $$QMAKE_CXXFLAGS_USE_PRECOMPILE
|
||||
|
||||
# elevated warnings
|
||||
contains(BLACK_CONFIG, AllowNoisyWarnings) {
|
||||
swiftConfig(allowNoisyWarnings) {
|
||||
clang {
|
||||
QMAKE_CXXFLAGS_WARN_ON *= -Weverything --system-header-prefix=$$[QT_INSTALL_HEADERS]
|
||||
QMAKE_CXXFLAGS_WARN_ON += -Wno-system-headers -Wno-c++98-compat-pedantic -Wno-class-varargs -Wno-covered-switch-default
|
||||
@@ -32,7 +32,7 @@ gcc {
|
||||
greaterThan(GCC_MAJOR, 5) {
|
||||
QMAKE_CXXFLAGS_WARN_ON *= -Wsuggest-override
|
||||
}
|
||||
greaterThan(GCC_MAJOR, 4):contains(BLACK_CONFIG, AllowNoisyWarnings) {
|
||||
greaterThan(GCC_MAJOR, 4):swiftConfig(allowNoisyWarnings) {
|
||||
QMAKE_CXXFLAGS_WARN_ON *= -Wsuggest-override
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ class Builder:
|
||||
shared_path = os.path.abspath(os.path.join(source_path, 'resources', 'share'))
|
||||
datastore.update_shared(host, datastore_version, shared_path)
|
||||
|
||||
def build(self, jobs, dev_build, eolInMonth):
|
||||
def build(self, jobs, qmake_args, dev_build, eolInMonth):
|
||||
"""
|
||||
Run the build itself. Pass dev_build=True to enable a dev build
|
||||
"""
|
||||
@@ -55,9 +55,9 @@ class Builder:
|
||||
os.makedirs(build_path)
|
||||
os.chdir(build_path)
|
||||
|
||||
qmake_call = ['qmake']
|
||||
qmake_call = ['qmake'] + qmake_args
|
||||
if dev_build:
|
||||
qmake_call += ['"BLACK_CONFIG+=SwiftDevBranch"']
|
||||
qmake_call += ['"SWIFT_CONFIG.devBranch=true"']
|
||||
|
||||
if eolInMonth > 0:
|
||||
eolYear = date.today().year
|
||||
@@ -66,7 +66,7 @@ class Builder:
|
||||
eolMonth = eolMonth % 12 + 1
|
||||
eolDate = date(int(eolYear), int(eolMonth), 1)
|
||||
print('Setting EOL date to ' + eolDate.strftime('%Y%m%d'))
|
||||
qmake_call += ['BLACK_EOL=' + eolDate.strftime('%Y%m%d')]
|
||||
qmake_call += ['SWIFT_CONFIG.endOfLife=' + eolDate.strftime('%Y%m%d')]
|
||||
|
||||
qmake_call += ['-r', os.pardir]
|
||||
subprocess.check_call(qmake_call, env=dict(os.environ))
|
||||
@@ -384,7 +384,7 @@ def print_help():
|
||||
'Windows': ['msvc', 'mingw']
|
||||
}
|
||||
compiler_help = '|'.join(supported_compilers[platform.system()])
|
||||
print('jenkins.py -c <config file> -w <32|64> -t <' + compiler_help + '> [-d] [-e <end of life in month>]')
|
||||
print('jenkins.py -c <config file> -w <32|64> -t <' + compiler_help + '> [-d] [-e <end of life in month>] [-q <extra qmake argument>]')
|
||||
|
||||
|
||||
# Entry point if called as a standalone program
|
||||
@@ -396,9 +396,10 @@ def main(argv):
|
||||
jobs = None
|
||||
upload_symbols = False
|
||||
eolInMonth = 0
|
||||
qmake_args = []
|
||||
|
||||
try:
|
||||
opts, args = getopt.getopt(argv, 'hc:w:t:j:due:', ['config=', 'wordsize=', 'toolchain=', 'jobs=', 'dev', 'upload', 'eol'])
|
||||
opts, args = getopt.getopt(argv, 'hc:w:t:j:due:q:', ['config=', 'wordsize=', 'toolchain=', 'jobs=', 'dev', 'upload', 'eol', 'qmake-arg='])
|
||||
except getopt.GetoptError:
|
||||
print_help()
|
||||
sys.exit(2)
|
||||
@@ -428,6 +429,8 @@ def main(argv):
|
||||
upload_symbols = True
|
||||
elif opt in ('-e', '--eol'):
|
||||
eolInMonth = int(arg)
|
||||
elif opt in ('-q', '--qmake-arg'):
|
||||
qmake_args += [arg]
|
||||
|
||||
if word_size not in ['32', '64']:
|
||||
print('Unsupported word size. Choose 32 or 64')
|
||||
@@ -450,7 +453,7 @@ def main(argv):
|
||||
builder = builders[platform.system()][tool_chain](config_file, word_size)
|
||||
|
||||
builder.prepare()
|
||||
builder.build(jobs, dev_build, eolInMonth)
|
||||
builder.build(jobs, qmake_args, dev_build, eolInMonth)
|
||||
builder.checks()
|
||||
builder.install()
|
||||
builder.publish()
|
||||
|
||||
@@ -13,20 +13,20 @@
|
||||
|
||||
const QDateTime &BlackConfig::CBuildConfig::getEol()
|
||||
{
|
||||
static const QString eol(\"$$BLACK_EOL\"); // config.pri
|
||||
static const QString eol(\"$$swiftConfig(endOfLife)\"); // config.pri
|
||||
static const QDateTime dt(eol.isEmpty() ? QDateTime() : QDateTime::fromString(eol, \"yyyyMMdd\"));
|
||||
return dt;
|
||||
}
|
||||
|
||||
int BlackConfig::CBuildConfig::vatsimClientId()
|
||||
{
|
||||
static const int id { $$VATSIM_CLIENT_ID };
|
||||
static const int id { $$swiftConfig(vatsim.id) };
|
||||
return id;
|
||||
}
|
||||
|
||||
const QString &BlackConfig::CBuildConfig::vatsimPrivateKey()
|
||||
{
|
||||
static const auto pk = QString { \"$$VATSIM_CLIENT_PRIVATE_KEY\" };
|
||||
static const auto pk = QString { \"$$swiftConfig(vatsim.key)\" };
|
||||
return pk;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,108 +11,94 @@
|
||||
#error This file is only to be included by buildconfig.inc
|
||||
#endif
|
||||
|
||||
$$DEFINE_WITH_BLACKCORE#define WITH_BLACKCORE
|
||||
$$DEFINE_WITH_BLACKSOUND#define WITH_BLACKSOUND
|
||||
$$DEFINE_WITH_BLACKINPUT#define WITH_BLACKINPUT
|
||||
$$DEFINE_WITH_BLACKGUI#define WITH_BLACKGUI
|
||||
$$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_FSUIPC#define WITH_FSUIPC
|
||||
$$DEFINE_WITH_XPLANE#define WITH_XPLANE
|
||||
$$DEFINE_SWIFT_VATSIM_SUPPORT#define SWIFT_VATSIM_SUPPORT
|
||||
|
||||
constexpr bool BlackConfig::CBuildConfig::isCompiledWithBlackCore()
|
||||
{
|
||||
#ifdef WITH_BLACKCORE
|
||||
!!IF swiftConfig(libs.blackcore)
|
||||
return true;
|
||||
#else
|
||||
!!ELSE
|
||||
return false;
|
||||
#endif
|
||||
!!ENDIF
|
||||
}
|
||||
|
||||
constexpr bool BlackConfig::CBuildConfig::isCompiledWithBlackSound()
|
||||
{
|
||||
#ifdef WITH_BLACKSOUND
|
||||
!!IF swiftConfig(libs.blacksound)
|
||||
return true;
|
||||
#else
|
||||
!!ELSE
|
||||
return false;
|
||||
#endif
|
||||
!!ENDIF
|
||||
}
|
||||
|
||||
constexpr bool BlackConfig::CBuildConfig::isCompiledWithBlackInput()
|
||||
{
|
||||
#ifdef WITH_BLACKINPUT
|
||||
!!IF swiftConfig(libs.blackinput)
|
||||
return true;
|
||||
#else
|
||||
!!ELSE
|
||||
return false;
|
||||
#endif
|
||||
!!ENDIF
|
||||
}
|
||||
|
||||
constexpr bool BlackConfig::CBuildConfig::isCompiledWithFs9Support()
|
||||
{
|
||||
#ifdef WITH_FS9
|
||||
!!IF swiftConfig(sims.fs9)
|
||||
return true;
|
||||
#else
|
||||
!!ELSE
|
||||
return false;
|
||||
#endif
|
||||
!!ENDIF
|
||||
}
|
||||
|
||||
constexpr bool BlackConfig::CBuildConfig::isCompiledWithP3DSupport()
|
||||
{
|
||||
#ifdef WITH_P3D
|
||||
!!IF swiftConfig(sims.p3d)
|
||||
return true;
|
||||
#else
|
||||
!!ELSE
|
||||
return false;
|
||||
#endif
|
||||
!!ENDIF
|
||||
}
|
||||
|
||||
constexpr bool BlackConfig::CBuildConfig::isCompiledWithFsxSupport()
|
||||
{
|
||||
#ifdef WITH_FSX
|
||||
!!IF swiftConfig(sims.fsx)
|
||||
return true;
|
||||
#else
|
||||
!!ELSE
|
||||
return false;
|
||||
#endif
|
||||
!!ENDIF
|
||||
}
|
||||
|
||||
constexpr bool BlackConfig::CBuildConfig::isCompiledWithFsuipcSupport()
|
||||
{
|
||||
#ifdef WITH_FSUIPC
|
||||
!!IF swiftConfig(sims.fsuipc)
|
||||
return true;
|
||||
#else
|
||||
!!ELSE
|
||||
return false;
|
||||
#endif
|
||||
!!ENDIF
|
||||
}
|
||||
|
||||
constexpr bool BlackConfig::CBuildConfig::isCompiledWithXPlaneSupport()
|
||||
{
|
||||
#ifdef WITH_XPLANE
|
||||
!!IF swiftConfig(sims.xplane)
|
||||
return true;
|
||||
#else
|
||||
!!ELSE
|
||||
return false;
|
||||
#endif
|
||||
!!ENDIF
|
||||
}
|
||||
|
||||
constexpr bool BlackConfig::CBuildConfig::isCompiledWithGui()
|
||||
{
|
||||
#ifdef WITH_BLACKGUI
|
||||
!!IF swiftConfig(libs.blackgui)
|
||||
return true;
|
||||
#else
|
||||
!!ELSE
|
||||
return false;
|
||||
#endif
|
||||
!!ENDIF
|
||||
}
|
||||
|
||||
constexpr bool BlackConfig::CBuildConfig::isVatsimVersion()
|
||||
{
|
||||
#ifdef SWIFT_VATSIM_SUPPORT
|
||||
!!IF swiftConfig(vatsimSupport)
|
||||
return true;
|
||||
#else
|
||||
!!ELSE
|
||||
return false;
|
||||
#endif
|
||||
!!ENDIF
|
||||
}
|
||||
|
||||
constexpr int BlackConfig::CBuildConfig::versionMajor() { return $$BLACK_VER_MAJ; }
|
||||
|
||||
@@ -8,7 +8,7 @@ TARGET = blackcore
|
||||
TEMPLATE = lib
|
||||
CONFIG += blackconfig blackmisc blackinput blacksound precompile_header
|
||||
|
||||
contains(BLACK_CONFIG, Static) {
|
||||
swiftConfig(static) {
|
||||
CONFIG += staticlib
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ TARGET = blackgui
|
||||
TEMPLATE = lib
|
||||
CONFIG += blackconfig blackmisc blackcore precompile_header
|
||||
|
||||
contains(BLACK_CONFIG, Static) {
|
||||
swiftConfig(static) {
|
||||
CONFIG += staticlib
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ TARGET = blackinput
|
||||
TEMPLATE = lib
|
||||
CONFIG += blackmisc
|
||||
|
||||
contains(BLACK_CONFIG, Static) {
|
||||
swiftConfig(static) {
|
||||
CONFIG += staticlib
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ TARGET = blackmisc
|
||||
TEMPLATE = lib
|
||||
CONFIG += blackconfig precompile_header
|
||||
|
||||
contains(BLACK_CONFIG, Static) {
|
||||
swiftConfig(static) {
|
||||
CONFIG += staticlib
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ TARGET = blacksound
|
||||
TEMPLATE = lib
|
||||
CONFIG += blackconfig blackmisc
|
||||
|
||||
contains(BLACK_CONFIG, Static) {
|
||||
swiftConfig(static) {
|
||||
CONFIG += staticlib
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ HEADERS += *.h
|
||||
LIBS *= -lsimulatorplugincommon
|
||||
addStaticLibraryDependency(simulatorplugincommon)
|
||||
|
||||
contains(BLACK_CONFIG, FSUIPC) {
|
||||
swiftConfig(sims.fsuipc) {
|
||||
equals(WORD_SIZE,32) {
|
||||
DEFINES += SWIFT_USING_FSUIPC32
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ DESTDIR = $$DestRoot/bin/plugins/simulator
|
||||
SOURCES += *.cpp
|
||||
HEADERS += *.h
|
||||
|
||||
REQUIRES += contains(BLACK_CONFIG,FSX)
|
||||
REQUIRES += swiftConfig(sims.fsx)
|
||||
TARGET = simulatorfsx
|
||||
DISTFILES += simulatorfsx.json
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ DESTDIR = $$DestRoot/bin/plugins/simulator
|
||||
SOURCES += *.cpp
|
||||
HEADERS += *.h
|
||||
|
||||
REQUIRES += contains(BLACK_CONFIG,FSX)
|
||||
REQUIRES += swiftConfig(sims.fsx)
|
||||
TARGET = simulatorfsxconfig
|
||||
DISTFILES += simulatorfsx.json
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ DESTDIR = $$DestRoot/bin/plugins/simulator
|
||||
SOURCES += *.cpp
|
||||
HEADERS += *.h
|
||||
|
||||
REQUIRES += contains(BLACK_CONFIG,P3D)
|
||||
REQUIRES += swiftConfig(sims.p3d)
|
||||
TARGET = simulatorp3d
|
||||
DISTFILES += simulatorp3d.json
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ DESTDIR = $$DestRoot/bin/plugins/simulator
|
||||
SOURCES += *.cpp
|
||||
HEADERS += *.h
|
||||
|
||||
REQUIRES += contains(BLACK_CONFIG,P3D)
|
||||
REQUIRES += swiftConfig(sims.p3d)
|
||||
TARGET = simulatorp3dconfig
|
||||
DISTFILES += simulatorp3d.json
|
||||
|
||||
|
||||
@@ -7,26 +7,26 @@ SUBDIRS += plugincommon
|
||||
SUBDIRS += emulated
|
||||
SUBDIRS += emulatedconfig
|
||||
|
||||
contains(BLACK_CONFIG,FSX|FS9|P3D) {
|
||||
swiftConfig(sims.fsx)|swiftConfig(sims.fs9)|swiftConfig(sims.p3d) {
|
||||
SUBDIRS += fsuipc32
|
||||
SUBDIRS += fsuipc64
|
||||
SUBDIRS += fscommon
|
||||
}
|
||||
contains(BLACK_CONFIG,FSX|P3D) {
|
||||
swiftConfig(sims.fsx)|swiftConfig(sims.p3d) {
|
||||
SUBDIRS += fsxcommon
|
||||
}
|
||||
contains(BLACK_CONFIG,P3D) {
|
||||
swiftConfig(sims.p3d) {
|
||||
SUBDIRS += p3d
|
||||
SUBDIRS += p3dconfig
|
||||
}
|
||||
contains(BLACK_CONFIG,FSX) {
|
||||
swiftConfig(sims.fsx) {
|
||||
SUBDIRS += fsx
|
||||
SUBDIRS += fsxconfig
|
||||
}
|
||||
contains(BLACK_CONFIG,FS9):contains(BLACK_CONFIG,FSUIPC) {
|
||||
swiftConfig(sims.fs9):swiftConfig(sims.fsuipc) {
|
||||
SUBDIRS += fs9
|
||||
}
|
||||
contains(BLACK_CONFIG,XPlane) {
|
||||
swiftConfig(sims.xplane) {
|
||||
SUBDIRS += xplane
|
||||
SUBDIRS += xplaneconfig
|
||||
}
|
||||
|
||||
18
src/src.pro
18
src/src.pro
@@ -5,31 +5,31 @@ CONFIG += ordered
|
||||
|
||||
SUBDIRS += blackconfig
|
||||
SUBDIRS += blackmisc
|
||||
contains(BLACK_CONFIG,BlackSound) {
|
||||
swiftConfig(libs.blacksound) {
|
||||
SUBDIRS += blacksound
|
||||
}
|
||||
contains(BLACK_CONFIG,BlackInput) {
|
||||
swiftConfig(libs.blackinput) {
|
||||
SUBDIRS += blackinput
|
||||
}
|
||||
contains(BLACK_CONFIG,BlackCore) {
|
||||
swiftConfig(libs.blackcore) {
|
||||
SUBDIRS += blackcore
|
||||
}
|
||||
contains(BLACK_CONFIG,BlackGui) {
|
||||
swiftConfig(libs.blackgui) {
|
||||
SUBDIRS += blackgui
|
||||
}
|
||||
contains(BLACK_CONFIG,SwiftGui) {
|
||||
swiftConfig(apps.swiftgui) {
|
||||
SUBDIRS += swiftguistandard
|
||||
}
|
||||
contains(BLACK_CONFIG,SwiftCore) {
|
||||
swiftConfig(apps.swiftcore) {
|
||||
SUBDIRS += swiftcore
|
||||
}
|
||||
contains(BLACK_CONFIG,SwiftData) {
|
||||
swiftConfig(apps.swiftdata) {
|
||||
SUBDIRS += swiftdata
|
||||
}
|
||||
contains(BLACK_CONFIG,SwiftLauncher) {
|
||||
swiftConfig(apps.swiftlauncher) {
|
||||
SUBDIRS += swiftlauncher
|
||||
}
|
||||
contains(BLACK_CONFIG,XPlane) {
|
||||
swiftConfig(sims.xplane) {
|
||||
SUBDIRS += xswiftbus
|
||||
}
|
||||
SUBDIRS += plugins
|
||||
|
||||
@@ -13,15 +13,15 @@ CheckMandatoryDependency(glu)
|
||||
CheckMandatoryDependency(libpng)
|
||||
CheckMandatoryDependency(zlib)
|
||||
|
||||
contains(BLACK_CONFIG,Doxygen) {
|
||||
swiftConfig(doxygen) {
|
||||
SUBDIRS += docs
|
||||
}
|
||||
SUBDIRS += resources
|
||||
SUBDIRS += src
|
||||
contains(BLACK_CONFIG,Samples) {
|
||||
swiftConfig(samples) {
|
||||
SUBDIRS += samples
|
||||
}
|
||||
contains(BLACK_CONFIG,Unittests) {
|
||||
swiftConfig(unitTests) {
|
||||
SUBDIRS += tests
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ SUBDIRS += blackgui
|
||||
# testblackcore.file = blackcore/testblackcore.pro
|
||||
# testblackgui.file = blackgui/testblackgui.pro
|
||||
|
||||
contains(BLACK_CONFIG,FSX|P3D) {
|
||||
swiftConfig(sims.fsx)|swiftConfig(sims.p3d) {
|
||||
SUBDIRS += testsimpluginfsxp3d
|
||||
testsimpluginfsxp3d.file = blacksimpluginfsxp3d/testblacksimpluginfsxp3d.pro
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user