Files
pilotclient/mkspecs/features/common_pre.prf
Roland Winklmeier 7317ddd155 Add first batch of configuration tests
Summary:
Configuration tests check whether all mandatory dependencies to build
swift are met. They can also be used to check optional dependencies, which
results in certain features to be enabled or disabled.
This first batch tests for mandatory libraries libpng, zlib and OpenGL.
If this is not tested and some libraries are missing, the developer will
be notified very late in the build.

Reviewers: #swift_pilot_client, msutcliffe

Reviewed By: #swift_pilot_client, msutcliffe

Subscribers: msutcliffe, jenkins

Differential Revision: https://dev.swift-project.org/D34
2017-09-24 19:49:30 +01:00

190 lines
5.4 KiB
Plaintext

# 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_MIC = $${BLACK_VER_MIC}
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++14
################################
# Detect 32 or 64 bit
################################
include(wordsize.pri)
################################
# Multithreaded build in VS IDE
################################
contains(TEMPLATE, "vc.*"): QMAKE_CXXFLAGS *= /MP
################################
# Profile build
################################
contains(BLACK_CONFIG, ProfileRelease) {
msvc {
QMAKE_CXXFLAGS_RELEASE *= /Zi
QMAKE_LFLAGS_RELEASE *= /DEBUG /PROFILE /INCREMENTAL:NO /OPT:REF /OPT:ICF
}
}
################################
# Workaround C1128 error
################################
msvc:!llvm: QMAKE_CXXFLAGS *= /bigobj
################################
# No gigantic MinGW obj files
################################
win32-g++: QMAKE_CXXFLAGS_DEBUG += -Og
################################
# FSX or FS9 on 32bit Windows only
################################
equals(WORD_SIZE,64)|!win32: BLACK_CONFIG -= FSX FS9
equals(WORD_SIZE,32)|!win32: BLACK_CONFIG -= P3D
################################
# For BlackMisc::getStackTrace
################################
linux-g++: QMAKE_LFLAGS_DEBUG *= -rdynamic
################################
# Suppress stupid warnings
################################
include(warnings.pri)
################################
# Handle addresses larger than 2GB
################################
equals(WORD_SIZE,32) {
win32-g++: QMAKE_LFLAGS *= -Wl,--large-address-aware
}
################################
# Externals
################################
include(externals.pri)
################################
# Includes
################################
INCLUDEPATH *= $$BuildRoot/src
################################
# Platform extensions
################################
isEmpty(QMAKE_EXTENSION_SHLIB) {
mac|ios: QMAKE_EXTENSION_SHLIB = dylib
else:win*: QMAKE_EXTENSION_SHLIB = dll
else: QMAKE_EXTENSION_SHLIB = so
}
isEmpty(QMAKE_EXTENSION_EXE) {
win32: QMAKE_EXTENSION_EXE = exe
}
################################
# Install prefix
################################
isEmpty(PREFIX) {
PREFIX = $$BuildRoot/dist
}
################################
# Debug Suffix
################################
win32: CONFIG(debug, debug|release): DLL_DEBUG_SUFFIX = d
################################
# Inter-project dependencies
################################
defineTest(addStaticLibraryDependency) {
win32:msvc: PRE_TARGETDEPS += $$DestRoot/lib/$${1}.lib
else: PRE_TARGETDEPS += $$DestRoot/lib/lib$${1}.a
export(PRE_TARGETDEPS)
}
defineTest(addLibraryDependency) {
contains(BLACK_CONFIG, Static) {
addStaticLibraryDependency($$1)
}
else {
win32:msvc: PRE_TARGETDEPS += $$DestRoot/lib/$${1}.lib
win32-g++*: PRE_TARGETDEPS += $$DestRoot/lib/lib$${1}.a
linux-g++*: PRE_TARGETDEPS += $$DestRoot/lib/lib$${1}.so
macx-clang: PRE_TARGETDEPS += $$DestRoot/lib/lib$${1}.dylib
export(PRE_TARGETDEPS)
}
}
################################
# Experimental support for Clang on Windows
################################
clang_cl {
QMAKE_CXXFLAGS ~= s/-fms-compatibility-version=.+/
QMAKE_CXXFLAGS += -fms-compatibility-version=19.00.24210
# QtCreator ships with a version of clang-cl,
# but we want to use the one in PATH instead.
system($$(SYSTEMROOT)\system32\where /q $$QMAKE_CXX) {
QMAKE_CC = $$system($$(SYSTEMROOT)\system32\where $$QMAKE_CXX)
QMAKE_CXX = $$QMAKE_CC
}
# Suppress warnings in Qt headers
QMAKE_RUN_CC = $(CC) -c $(CFLAGS) $(INCPATH:-I$$system_path($$[QT_HOST_PREFIX])=/imsvc $$system_path($$[QT_HOST_PREFIX])) -Fo$obj $src
QMAKE_RUN_CC_IMP = $(CC) -c $(CFLAGS) $(INCPATH:-I$$system_path($$[QT_HOST_PREFIX])=/imsvc $$system_path($$[QT_HOST_PREFIX])) -Fo$@ $<
QMAKE_RUN_CC_IMP_BATCH = $(CC) -c $(CFLAGS) $(INCPATH:-I$$system_path($$[QT_HOST_PREFIX])=/imsvc $$system_path($$[QT_HOST_PREFIX])) -Fo$@ @<<
QMAKE_RUN_CXX = $(CXX) -c $(CXXFLAGS) $(INCPATH:-I$$system_path($$[QT_HOST_PREFIX])=/imsvc $$system_path($$[QT_HOST_PREFIX])) -Fo$obj $src
QMAKE_RUN_CXX_IMP = $(CXX) -c $(CXXFLAGS) $(INCPATH:-I$$system_path($$[QT_HOST_PREFIX])=/imsvc $$system_path($$[QT_HOST_PREFIX])) -Fo$@ $<
QMAKE_RUN_CXX_IMP_BATCH = $(CXX) -c $(CXXFLAGS) $(INCPATH:-I$$system_path($$[QT_HOST_PREFIX])=/imsvc $$system_path($$[QT_HOST_PREFIX])) -Fo$@ @<<
}