refs #482 Added new qmake feature files and includes.

This commit is contained in:
Mathew Sutcliffe
2015-10-06 23:33:22 +01:00
parent 2d429efbde
commit dbb5a240da
9 changed files with 316 additions and 1 deletions

View File

@@ -1,2 +1,4 @@
SourceRoot=$$PWD
BuildRoot=$$shadowed($$PWD)
BuildRoot=$$shadowed($$SourceRoot)
DestRootDebug=$$BuildRoot/out/debug
DestRootRelease=$$BuildRoot/out/release

View File

@@ -0,0 +1,39 @@
################################
# Externals
################################
INCLUDEPATH *= $$EXTERNALDIR/common/include
# and the library path depending on the used compiler
win32-msvc2010 {
equals(WORD_SIZE,64): LIBS *= -L$$EXTERNALDIR/vs2010_64/lib
equals(WORD_SIZE,32): LIBS *= -L$$EXTERNALDIR/vs2010_32/lib
equals(WORD_SIZE,32): LIBS += -luser32
}
win32-msvc2013 {
INCLUDEPATH *= $$EXTERNALDIR/win32-vs2013/include
equals(WORD_SIZE,64): LIBS *= -L$$EXTERNALDIR/win32-vs2013/lib64
equals(WORD_SIZE,32): LIBS *= -L$$EXTERNALDIR/win32-vs2013/lib32
equals(WORD_SIZE,32): LIBS += -luser32
}
win32-g++ {
INCLUDEPATH *= $$EXTERNALDIR/win32-g++/include
equals(WORD_SIZE,64): LIBS *= -L$$EXTERNALDIR/win32-g++/lib64
equals(WORD_SIZE,32): LIBS *= -L$$EXTERNALDIR/win32-g++/lib32
LIBS += -luser32
}
linux-g++* {
equals(WORD_SIZE,64): LIBS *= -L$$EXTERNALDIR/linux-g++/lib64
equals(WORD_SIZE,32): LIBS *= -L$$EXTERNALDIR/linux-g++/lib32
}
macx-clang {
INCLUDEPATH *= $$EXTERNALDIR/macx-clang/include
equals(WORD_SIZE,64): LIBS *= -L$$EXTERNALDIR/macx-clang/lib64 -F$$EXTERNALDIR/macx-clang/lib64
equals(WORD_SIZE,32): LIBS *= -L$$EXTERNALDIR/macx-clang/lib32 -F$$EXTERNALDIR/macx-clang/lib32
}
################################
# Black libs
################################
include(libraries.pri)

View File

@@ -0,0 +1,112 @@
# Copyright (C) 2015
# 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.
################################
# Version number
################################
include(version.pri)
!win32 {
VER_MAJ = $${BLACK_VER_MAJ}
VER_MIN = $${BLACK_VER_MIN}
VER_PAT = $${BLACK_VER_PAT}
VERSION = $${BLACK_VERSION}
}
################################
# Destination tree
################################
CONFIG(debug, debug|release): DestRoot = $$DestRootDebug
else: DestRoot = $$DestRootRelease
################################
# Build configuration
################################
include(config.pri)
################################
# QMake options
################################
CONFIG += qt
CONFIG += warn_on
CONFIG += c++11
################################
# Detect 32 or 64 bit
################################
include(wordsize.pri)
################################
# Profile build
################################
contains(BLACK_CONFIG, ProfileRelease) {
win32-msvc* {
QMAKE_CXXFLAGS_RELEASE *= /Zi
QMAKE_LFLAGS_RELEASE *= /DEBUG /PROFILE /INCREMENTAL:NO /OPT:REF /OPT:ICF
}
}
# Needed to workaround C1128 error
# TODO check whether this is still needed after CValueObject refactoring
win32-msvc*: QMAKE_CXXFLAGS *= /bigobj
################################
# No incremental build
################################
# win32-msvc*:QMAKE_LFLAGS_DEBUG *= /INCREMENTAL:NO
################################
# No gigantic MinGW obj files
################################
win32-g++: QMAKE_CXXFLAGS_DEBUG += -Og
################################
# No FSX or FS9 for 64 bit
################################
equals(WORD_SIZE,64): BLACK_CONFIG -= FSX FS9
################################
# Suppress stupid warnings
################################
include(warnings.pri)
################################
# Preprocessor defines
################################
include(defines.pri)
################################
# Path to external dependencies
################################
# If you want to manually set the external path, uncomment the following line
# EXTERNALDIR = /path/to/externals
isEmpty(EXTERNALDIR) {
EXTERNALDIR = $$(VATSIM_EXTERNAL_DIR)
}
isEmpty(EXTERNALDIR) {
EXTERNALDIR = $$SourceRoot/externals
}
!exists("$$EXTERNALDIR/common/include") {
error("Could not find externals in $$EXTERNALDIR. Please install it!")
}

View File

@@ -0,0 +1,15 @@
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 += FS9
BLACK_CONFIG += FSX
BLACK_CONFIG += XPlane
BLACK_CONFIG += ProfileRelease
#BLACK_CONFIG += Static
#BLACK_CONFIG += Doxygen

View File

@@ -0,0 +1,14 @@
DEFINES += BLACK_VERSION=$$BLACK_VERSION
contains(BLACK_CONFIG, BlackSound) { DEFINES += WITH_BLACKSOUND }
contains(BLACK_CONFIG, BlackInput) { DEFINES += WITH_BLACKINPUT }
contains(BLACK_CONFIG, BlackSim) { DEFINES += WITH_BLACKSIM }
contains(BLACK_CONFIG, BlackCore) { DEFINES += WITH_BLACKCORE }
contains(BLACK_CONFIG, BlackGui) { DEFINES += WITH_BLACKGUI }
contains(BLACK_CONFIG, SwiftData) { DEFINES += WITH_SWIFTDATA }
contains(BLACK_CONFIG, SwiftGui) { DEFINES += WITH_SWIFTGUI }
contains(BLACK_CONFIG, SwiftCore) { DEFINES += WITH_SWIFTCORE }
contains(BLACK_CONFIG, FSX) { DEFINES += WITH_FSX }
contains(BLACK_CONFIG, FS9) { DEFINES += WITH_FS9 }
contains(BLACK_CONFIG, XPlane) { DEFINES += WITH_XPLANE }
contains(BLACK_CONFIG, Static) { DEFINES += WITH_STATIC }

View File

@@ -0,0 +1,81 @@
LIBS *= -L$$DestRoot/lib
unix:!macx {
# Set the rpath-link to find dependent shared libraries when linking
# Note: This does not add any rpath into the binaries.
LIBS += -Wl,-rpath-link,$$DestRoot/lib
}
blackgui {
contains(BLACK_CONFIG, Static) {
win32-msvc*: PRE_TARGETDEPS += $$DestRoot/lib/blackgui.lib
else: PRE_TARGETDEPS += $$DestRoot/lib/libblackgui.a
} else {
win32-msvc*: PRE_TARGETDEPS += $$DestRoot/lib/blackgui.lib
win32-g++*: PRE_TARGETDEPS += $$DestRoot/lib/libblackgui.a
linux-g++*: PRE_TARGETDEPS += $$DestRoot/lib/libblackgui.so
macx-clang: PRE_TARGETDEPS += $$DestRoot/lib/libblackgui.dylib
}
LIBS *= -lblackgui
}
blackcore {
contains(BLACK_CONFIG, Static) {
win32-msvc*: PRE_TARGETDEPS += $$DestRoot/lib/blackcore.lib
else: PRE_TARGETDEPS += $$DestRoot/lib/libblackcore.a
} else {
win32-msvc*: PRE_TARGETDEPS += $$DestRoot/lib/blackcore.lib
win32-g++*: PRE_TARGETDEPS += $$DestRoot/lib/libblackcore.a
linux-g++*: PRE_TARGETDEPS += $$DestRoot/lib/libblackcore.so
macx-clang: PRE_TARGETDEPS += $$DestRoot/lib/libblackcore.dylib
}
LIBS *= -lblackcore -lvatlib2
win32 {
contains(BLACK_CONFIG, FSX) {
LIBS *= -lSimConnect
LIBS *= -lFSUIPC_User
}
}
}
blacksound {
LIBS *= -lblacksound
}
blackinput {
contains(BLACK_CONFIG, Static) {
win32-msvc*: PRE_TARGETDEPS += $$DestRoot/lib/blackinput.lib
else: PRE_TARGETDEPS += $$DestRoot/lib/libblackinput.a
} else {
win32-msvc*: PRE_TARGETDEPS += $$DestRoot/lib/blackinput.lib
win32-g++*: PRE_TARGETDEPS += $$DestRoot/lib/libblackinput.a
linux-g++*: PRE_TARGETDEPS += $$DestRoot/lib/libblackinput.so
macx-clang: PRE_TARGETDEPS += $$DestRoot/lib/libblackinput.dylib
}
LIBS *= -lblackinput
macx {
LIBS += -framework CoreFoundation -framework ApplicationServices -framework Foundation -framework AppKit
}
win32 {
LIBS *= -ldxguid -lole32 -ldinput8 -lUser32
}
}
blackmisc {
contains(BLACK_CONFIG, Static) {
win32-msvc*: PRE_TARGETDEPS += $$DestRoot/lib/blackmisc.lib
else: PRE_TARGETDEPS += $$DestRoot/lib/libblackmisc.a
} else {
win32-msvc*: PRE_TARGETDEPS += $$DestRoot/lib/blackmisc.lib
win32-g++*: PRE_TARGETDEPS += $$DestRoot/lib/libblackmisc.a
linux-g++*: PRE_TARGETDEPS += $$DestRoot/lib/libblackmisc.so
macx-clang: PRE_TARGETDEPS += $$DestRoot/lib/libblackmisc.dylib
}
LIBS *= -lblackmisc
}

View File

@@ -0,0 +1,4 @@
BLACK_VER_MAJ = 0
BLACK_VER_MIN = 6
BLACK_VER_PAT = 1
BLACK_VERSION = $${BLACK_VER_MAJ}.$${BLACK_VER_MIN}.$${BLACK_VER_PAT}

View File

@@ -0,0 +1,11 @@
win32-msvc*:DEFINES *= _SCL_SECURE_NO_WARNINGS
# win32-msvc*:QMAKE_CXXFLAGS *=
# exclude Qt lib warnings
# win32-g++: QMAKE_CXXFLAGS += $$join(QMAKE_INCDIR_QT, " -isystem", "-isystem")
# swift standard warnings
win32-msvc*:QMAKE_CXXFLAGS_WARN_ON *= /wd4351 /wd4661
# elevated warnings
# win32-msvc*:QMAKE_CXXFLAGS_WARN_ON *= /Wall /wd4640 /wd4619 /wd4350 /wd4351 /wd4946 /wd4510 /wd4820 /wd4571 /wd4625 /wd4626 /wd4127

View File

@@ -0,0 +1,37 @@
win32-msvc* {
win32:contains(QMAKE_TARGET.arch, x86_64) {
WORD_SIZE = 64
}
else {
WORD_SIZE = 32
}
}
win32-g++ {
WIN_FIND = $$(SYSTEMROOT)\system32\find
MINGW64 = $$system($$QMAKE_CXX -Q --help=target | $$WIN_FIND \"-m64\")
contains(MINGW64,[enabled]) {
WORD_SIZE = 64
}
else {
WORD_SIZE = 32
}
}
linux-g++ {
GCC64 = $$system($$QMAKE_CXX -Q --help=target | grep m64)
contains(GCC64,[enabled]) {
WORD_SIZE = 64
}
else {
WORD_SIZE = 32
}
}
linux-g++-32 {
WORD_SIZE = 32
}
linux-g++-64 {
WORD_SIZE = 64
}
macx-clang {
# TODO
WORD_SIZE = 64
}