summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mkspecs/common/ios/qmake.conf27
-rw-r--r--mkspecs/common/ios/versions.conf103
2 files changed, 42 insertions, 88 deletions
diff --git a/mkspecs/common/ios/qmake.conf b/mkspecs/common/ios/qmake.conf
index 1b7a7d2328..ce2124f4fe 100644
--- a/mkspecs/common/ios/qmake.conf
+++ b/mkspecs/common/ios/qmake.conf
@@ -9,29 +9,10 @@
# QMAKE_IOSSIMULATOR_SDK_VERSION - set in mkspecs/common/ios/versions.conf
#
-# iOS SDK device type
-!*simulator*: QMAKE_IOS_DEVICE_TYPE = iPhoneOS
-else {
- QMAKE_IOS_DEVICE_TYPE = iPhoneSimulator
-
- # Use simulator SDK version
- QMAKE_IOS_SDK_VERSION = $$QMAKE_IOS_SIMULATOR_SDK_VERSION
- QMAKE_IOS_SIMULATOR_SDK_VERSION =
-}
-
-# iOS platform /Developer path
-QMAKE_IOS_DEV_PATH = $$QMAKE_XCODE_DEVELOPER_PATH/Platforms/$${QMAKE_IOS_DEVICE_TYPE}.platform/Developer
-
-# iOS platform SDK path
-QMAKE_IOS_SDK = $$QMAKE_IOS_DEV_PATH/SDKs/$${QMAKE_IOS_DEVICE_TYPE}$${QMAKE_IOS_SDK_VERSION}.sdk
-QMAKE_IOS_DEV_PATH =
-QMAKE_IOS_DEVICE_TYPE =
-
-QMAKE_CFLAGS += -isysroot $$QMAKE_IOS_SDK
-QMAKE_CXXFLAGS += -isysroot $$QMAKE_IOS_SDK
-QMAKE_OBJECTIVE_CFLAGS += -isysroot $$QMAKE_IOS_SDK
-QMAKE_LFLAGS += -Wl,-syslibroot,$$QMAKE_IOS_SDK
-QMAKE_IOS_SDK =
+QMAKE_CFLAGS += -isysroot $$QMAKE_IOS_SDK_PATH
+QMAKE_CXXFLAGS += -isysroot $$QMAKE_IOS_SDK_PATH
+QMAKE_OBJECTIVE_CFLAGS += -isysroot $$QMAKE_IOS_SDK_PATH
+QMAKE_LFLAGS += -Wl,-syslibroot,$$QMAKE_IOS_SDK_PATH
# Basic iOS frameworks needed for any GUI app
QMAKE_LFLAGS += -framework Foundation -framework UIKit -framework QuartzCore -lz
diff --git a/mkspecs/common/ios/versions.conf b/mkspecs/common/ios/versions.conf
index 8f9804e5cf..b46905ff65 100644
--- a/mkspecs/common/ios/versions.conf
+++ b/mkspecs/common/ios/versions.conf
@@ -4,8 +4,7 @@
# 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
+# QMAKE_IOS_SDK_VERSION - version number of iOS SDK
#
# Used in:
#
@@ -29,15 +28,12 @@
# autodetection (slower!)
#
-# Xcode version used for cross-compiling
+# Xcode version used
QMAKE_IOS_XCODE_VERSION =
-# iOS SDK version used for cross-compiling for iOS devices
+# iOS SDK version used
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
#
@@ -73,73 +69,50 @@ 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
+# iOS SDK device type
+!*simulator*: QMAKE_IOS_DEVICE_TYPE = iPhoneOS
+else: QMAKE_IOS_DEVICE_TYPE = iPhoneSimulator
+
+# iOS platform /Developer path
+QMAKE_IOS_DEV_PATH = $$QMAKE_XCODE_DEVELOPER_PATH/Platforms/$${QMAKE_IOS_DEVICE_TYPE}.platform/Developer
+
# 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
- }
+# No iOS SDK version specified?
+isEmpty(QMAKE_IOS_SDK_VERSION) {
+ # Get names of installed SDKs
+ sdk_identifier = $$lower($$QMAKE_IOS_DEVICE_TYPE)
+ sdks = $$find(QMAKE_XCODE_SDKS, ^$$sdk_identifier)
+ for(v, sdks): {
+ # Extract SDK version number from output
+ v = $$replace(v,$$sdk_identifier,)
+
+ # 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.")
- }
+ isEmpty(QMAKE_IOS_SDK_VERSION): error("Could not find a usable SDK, please install using Xcode")
+}
- # 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
- }
+# iOS platform SDK path
+QMAKE_IOS_SDK_PATH = $$QMAKE_IOS_DEV_PATH/SDKs/$${QMAKE_IOS_DEVICE_TYPE}$${QMAKE_IOS_SDK_VERSION}.sdk
- # 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.")
- }
+# Make sure iOS SDK version is valid
+!exists($$QMAKE_IOS_SDK_PATH): error("iOS $$QMAKE_IOS_SDK_VERSION SDK not found at $$QMAKE_IOS_SDK_PATH")
- # 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
- }
+# 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 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.")
- }
+# 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.")
}
unset(QMAKE_IPHONEOS_PREFERRED_TARGET)