6382105f3d
We only want to support Clang. Change-Id: Id0558df905106158f4c25ca10462bf4ca41e1e45 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
157 lines
6.0 KiB
Plaintext
157 lines
6.0 KiB
Plaintext
#
|
|
# Helper to set build tool & SDK versions for iOS configurations
|
|
#
|
|
# This file sets up the following configuration variables:
|
|
#
|
|
# QMAKE_IOS_XCODE_VERSION - version number of Xcode being used
|
|
# QMAKE_IOS_SDK_VERSION - version number of iOS device SDK
|
|
# QMAKE_IOS_SIMULATOR_SDK_VERSION - version number of iOS simulator SDK
|
|
#
|
|
# Used in:
|
|
#
|
|
# mkspecs/common/ios/clang.conf
|
|
# mkspecs/common/ios/qmake.conf
|
|
# mkspecs/unsupported/macx-iosdevice-clang/qmake.conf
|
|
#
|
|
|
|
#
|
|
# IMPORTANT:
|
|
#
|
|
# Xcode versions >= 4.10 & < 5.0 and versions >= 10.0 are not supported due to
|
|
# the way the version checks are done here. As Apple (so far) has not used
|
|
# minor version numbers greater than 3 for Xcode, and the Xcode major version
|
|
# has only changed three times in the period 2003-2012, this is viewed as an
|
|
# acceptable limitation.
|
|
#
|
|
|
|
#
|
|
# Edit values below to match iOS build environment, or leave blank for
|
|
# autodetection (slower!)
|
|
#
|
|
|
|
# Xcode version used for cross-compiling
|
|
QMAKE_IOS_XCODE_VERSION =
|
|
|
|
# iOS SDK version used for cross-compiling for iOS devices
|
|
QMAKE_IOS_SDK_VERSION =
|
|
|
|
# iOS SDK version used for cross-compiling for the iOS simulator
|
|
QMAKE_IOS_SIMULATOR_SDK_VERSION =
|
|
|
|
#
|
|
# Do not edit values below here if using a pre-built SDK
|
|
#
|
|
|
|
# Minimum iOS version required on deployment target (if not specified, will
|
|
# default to minimum version that guarantees ARMv7 & OpenGL/ES 2.x).
|
|
#
|
|
# No part of Qt or any known plugin uses features that require iOS versions
|
|
# later than 4.0.
|
|
QMAKE_IPHONEOS_DEPLOYMENT_TARGET = 4.0
|
|
|
|
###########################################################################
|
|
|
|
# Get path of Xcode's Developer directory
|
|
QMAKE_XCODE_DEVELOPER_PATH = $$system(xcode-select --print-path)
|
|
|
|
# Make sure Xcode path is valid
|
|
!exists($$QMAKE_XCODE_DEVELOPER_PATH): \
|
|
error("Xcode is not installed in $${QMAKE_XCODE_DEVELOPER_PATH}! Please use xcode-select to choose Xcode installation path")
|
|
|
|
# No Xcode version specified?
|
|
isEmpty(QMAKE_IOS_XCODE_VERSION) {
|
|
# Get version string from installed Xcode
|
|
QMAKE_IOS_XCODE_INFO = $$system($${QMAKE_XCODE_DEVELOPER_PATH}/usr/bin/xcodebuild -version)
|
|
|
|
# Extract Xcode version number from output
|
|
QMAKE_IOS_XCODE_VERSION = $$member(QMAKE_IOS_XCODE_INFO, 1)
|
|
QMAKE_IOS_XCODE_INFO =
|
|
}
|
|
|
|
QMAKE_XCODE_PLATFORM_PATH = $${QMAKE_XCODE_DEVELOPER_PATH}/Platforms
|
|
|
|
# iOS 4.3 is the preferred version as it is the earliest version that is armv7/gles2 only
|
|
QMAKE_IPHONEOS_PREFERRED_TARGET = 4.3
|
|
|
|
# Get lists of installed SDKs from Xcode
|
|
QMAKE_XCODE_SDKS = $$system($${QMAKE_XCODE_DEVELOPER_PATH}/usr/bin/xcodebuild -showsdks)
|
|
|
|
# Building for iOS device?
|
|
!*simulator* {
|
|
# No iOS SDK version specified?
|
|
isEmpty(QMAKE_IOS_SDK_VERSION) {
|
|
# Get names of installed device SDKs
|
|
iphoneos_sdks = $$find(QMAKE_XCODE_SDKS, ^iphoneos)
|
|
for(v, iphoneos_sdks): {
|
|
# Extract SDK version number from output
|
|
v = $$replace(v,iphoneos,)
|
|
|
|
# Use latest SDK version
|
|
greaterThan(v, $$QMAKE_IOS_SDK_VERSION): QMAKE_IOS_SDK_VERSION = $$v
|
|
}
|
|
}
|
|
|
|
# Make sure iOS SDK version is valid
|
|
!exists($$QMAKE_XCODE_PLATFORM_PATH/iPhoneOS.platform/Developer/SDKs/iPhoneOS$${QMAKE_IOS_SDK_VERSION}.sdk) {
|
|
error("iOS $$QMAKE_IOS_SDK_VERSION SDK not found! Edit mkspecs/common/ios/versions.conf to specify version installed.")
|
|
}
|
|
|
|
# No deployment target specified?
|
|
isEmpty(QMAKE_IPHONEOS_DEPLOYMENT_TARGET) {
|
|
# Use SDK version for iOS versions < preferred
|
|
lessThan(QMAKE_IOS_SDK_VERSION, $$QMAKE_IPHONEOS_PREFERRED_TARGET) {
|
|
QMAKE_IPHONEOS_DEPLOYMENT_TARGET = $$QMAKE_IOS_SDK_VERSION
|
|
} else: QMAKE_IPHONEOS_DEPLOYMENT_TARGET = $$QMAKE_IPHONEOS_PREFERRED_TARGET
|
|
}
|
|
|
|
# Make sure iOS SDK version is >= iOS target version
|
|
!lessThan(QMAKE_IPHONEOS_DEPLOYMENT_TARGET, $$QMAKE_IOS_SDK_VERSION) {
|
|
error("Target iOS version is greater that iOS SDK version $$QMAKE_IOS_SDK_VERSION! Edit mkspecs/common/ios/versions.conf to specify target iOS version.")
|
|
}
|
|
# Building for iOS simulator
|
|
} else {
|
|
# No iOS simulator SDK version specified?
|
|
isEmpty(QMAKE_IOS_SIMULATOR_SDK_VERSION) {
|
|
# Get names of installed device SDKs
|
|
iphone_simulator_sdks = $$find(QMAKE_XCODE_SDKS, ^iphonesimulator)
|
|
for(v, iphone_simulator_sdks): {
|
|
# Extract SDK version number from output
|
|
v = $$replace(v,iphonesimulator,)
|
|
|
|
# Use latest SDK version
|
|
greaterThan(v, $$QMAKE_IOS_SIMULATOR_SDK_VERSION): QMAKE_IOS_SIMULATOR_SDK_VERSION = $$v
|
|
}
|
|
}
|
|
|
|
# Make sure iOS simulator SDK version is valid
|
|
!exists($$QMAKE_XCODE_PLATFORM_PATH/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator$${QMAKE_IOS_SIMULATOR_SDK_VERSION}.sdk) {
|
|
error("iOS $$QMAKE_IOS_SIMULATOR_SDK_VERSION simulator SDK not found! Edit mkspecs/common/ios/versions.conf to specify version installed.")
|
|
}
|
|
|
|
# No deployment target specified?
|
|
isEmpty(QMAKE_IPHONEOS_DEPLOYMENT_TARGET) {
|
|
# Use SDK version for iOS versions < preferred
|
|
lessThan(QMAKE_IOS_SIMULATOR_SDK_VERSION, $$QMAKE_IPHONEOS_PREFERRED_TARGET) {
|
|
QMAKE_IPHONEOS_DEPLOYMENT_TARGET = $$QMAKE_IOS_SIMULATOR_SDK_VERSION
|
|
} else: QMAKE_IPHONEOS_DEPLOYMENT_TARGET = $$QMAKE_IPHONEOS_PREFERRED_TARGET
|
|
}
|
|
|
|
# Make sure iOS simulator SDK version is >= iOS target version
|
|
!lessThan(QMAKE_IPHONEOS_DEPLOYMENT_TARGET, $$QMAKE_IOS_SIMULATOR_SDK_VERSION) {
|
|
error("Target iOS version is greater that iOS simulator SDK version $$QMAKE_IOS_SIMULATOR_SDK_VERSION! Edit mkspecs/common/ios/versions.conf to specify target iOS version.")
|
|
}
|
|
}
|
|
|
|
unset(QMAKE_IPHONEOS_PREFERRED_TARGET)
|
|
unset(QMAKE_XCODE_PLATFORM_PATH)
|
|
|
|
# Set deployment target
|
|
QMAKE_IOS_VERSION_FLAGS = -miphoneos-version-min=$$QMAKE_IPHONEOS_DEPLOYMENT_TARGET
|
|
|
|
# Set build flags
|
|
QMAKE_CFLAGS += $$QMAKE_IOS_VERSION_FLAGS
|
|
QMAKE_CXXFLAGS += $$QMAKE_IOS_VERSION_FLAGS
|
|
QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_IOS_VERSION_FLAGS
|
|
QMAKE_LFLAGS += $$QMAKE_IOS_VERSION_FLAGS
|
|
QMAKE_IOS_VERSION_FLAGS =
|