diff options
author | Tor Arne Vestbø <tor.arne.vestbo@digia.com> | 2012-11-20 15:25:34 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@digia.com> | 2013-02-27 13:07:16 +0100 |
commit | c3278e33534fe937fe367dfbf648282ceba68c7f (patch) | |
tree | 31b266cd37ee052adabc5ee9343636974c912168 /mkspecs/common | |
parent | 67f925701b490e3e9cdbb0dbbfc1a14d1b409bd3 (diff) |
iOS: Replace device and simulator makespecs with single makespec
And use configure's -sdk argument to choose between the iphoneos and the
iphonesimulator SDK. xcodebuild -showsdks can be used to list the
available SDKs. Passing an SDK without a version postfix implies
the latest version of the SDK.
Change-Id: I881df754d522fc91aaa16ba3e39cf0c37a21a1f1
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Diffstat (limited to 'mkspecs/common')
-rw-r--r-- | mkspecs/common/ios.conf | 3 | ||||
-rw-r--r-- | mkspecs/common/ios/arch.conf | 13 | ||||
-rw-r--r-- | mkspecs/common/ios/clang.conf | 9 | ||||
-rw-r--r-- | mkspecs/common/ios/qmake.conf | 6 | ||||
-rw-r--r-- | mkspecs/common/ios/versions.conf | 120 | ||||
-rw-r--r-- | mkspecs/common/xcode.conf | 13 |
6 files changed, 25 insertions, 139 deletions
diff --git a/mkspecs/common/ios.conf b/mkspecs/common/ios.conf index 890446d844..0d68d37ff8 100644 --- a/mkspecs/common/ios.conf +++ b/mkspecs/common/ios.conf @@ -12,6 +12,9 @@ CONFIG -= app_bundle # Not deploying to Mac OSX QMAKE_MACOSX_DEPLOYMENT_TARGET = +# But to iOS +QMAKE_IOS_DEPLOYMENT_TARGET = 4.3 + # Add iOS common folder to include path INCLUDEPATH += $$PWD/ios diff --git a/mkspecs/common/ios/arch.conf b/mkspecs/common/ios/arch.conf deleted file mode 100644 index 6bd27a6136..0000000000 --- a/mkspecs/common/ios/arch.conf +++ /dev/null @@ -1,13 +0,0 @@ -# -# Helper to set CPU architecture flags for iOS configurations -# -########################################################################### - -QMAKE_IOS_ARCH_FLAGS = -arch $$QMAKE_IOS_TARGET_ARCH - -QMAKE_CFLAGS += $$QMAKE_IOS_ARCH_FLAGS -QMAKE_CXXFLAGS += $$QMAKE_IOS_ARCH_FLAGS -QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_IOS_ARCH_FLAGS -QMAKE_LFLAGS += $$QMAKE_IOS_ARCH_FLAGS - -unset(QMAKE_IOS_ARCH_FLAGS) diff --git a/mkspecs/common/ios/clang.conf b/mkspecs/common/ios/clang.conf index 42400c9775..9b092d3fa4 100644 --- a/mkspecs/common/ios/clang.conf +++ b/mkspecs/common/ios/clang.conf @@ -3,7 +3,7 @@ # # Depends on: # -# QMAKE_IOS_XCODE_VERSION - set in mkspecs/common/ios/versions.conf +# QMAKE_IOS_XCODE_VERSION - set in macx-ios-clang/qmake.conf # # iOS build flags @@ -12,6 +12,13 @@ QMAKE_IOS_CFLAGS += -Wno-trigraphs -Wreturn-type -Wparentheses -Wswitch -W QMAKE_IOS_CXXFLAGS += -fvisibility-inlines-hidden QMAKE_IOS_OBJ_CFLAGS += -Wno-arc-abi -Wc++0x-extensions +# Based on the following information, http://clang.llvm.org/doxygen/ObjCRuntime_8h_source.html, +# we can conclude that it's safe to always pass the following flags +QMAKE_IOS_OBJ_CFLAGS += -fobjc-nonfragile-abi -fobjc-legacy-dispatch + +# But these only apply to non-ARM targets +!contains(QT_ARCH, arm): QMAKE_IOS_CFLAGS += -fexceptions -fasm-blocks + # Clang 3.1 (and above) flags QMAKE_IOS_CFLAGS += -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-implicit-atomic-properties -Wformat -Wno-missing-braces -Wno-unused-function -Wno-unused-label -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-sign-compare -Wpointer-sign -Wno-newline-eof -Wdeprecated-declarations -Winvalid-offsetof -Wno-conversion QMAKE_IOS_CXXFLAGS += -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wc++11-extensions diff --git a/mkspecs/common/ios/qmake.conf b/mkspecs/common/ios/qmake.conf index 9235e68b0d..2a8d64fd9f 100644 --- a/mkspecs/common/ios/qmake.conf +++ b/mkspecs/common/ios/qmake.conf @@ -3,11 +3,7 @@ # # Depends on: # -# QMAKE_XCODE_DEVELOPER_PATH - set in mkspecs/common/ios/versions.conf -# QMAKE_IOS_XCODE_VERSION - set in mkspecs/common/ios/versions.conf -# QMAKE_IOS_SDK_VERSION - set in mkspecs/common/ios/versions.conf -# QMAKE_IOSSIMULATOR_SDK_VERSION - set in mkspecs/common/ios/versions.conf -# +# QMAKE_XCODE_DEVELOPER_PATH - set in mkspecs/common/xcode.conf QMAKE_XCODE_TOOLCHAIN_BIN_PATH = $$QMAKE_XCODE_DEVELOPER_PATH/Toolchains/XcodeDefault.xctoolchain/usr/bin diff --git a/mkspecs/common/ios/versions.conf b/mkspecs/common/ios/versions.conf deleted file mode 100644 index 7c2acf9da5..0000000000 --- a/mkspecs/common/ios/versions.conf +++ /dev/null @@ -1,120 +0,0 @@ -# -# 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 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 -QMAKE_IOS_XCODE_VERSION = - -# iOS SDK version used -QMAKE_IOS_SDK_VERSION = - -# -# Do not edit values below here if using a pre-built SDK -# - -# Minimum iOS version required on deployment target -QMAKE_IPHONEOS_DEPLOYMENT_TARGET = 4.3 - -########################################################################### - -# 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 = -} - -# Version check -lessThan(QMAKE_IOS_XCODE_VERSION, "4.3"): error("This mkspec requires Xcode 4.3 or later") - -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 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) - -# 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 - } - - # We have at least one version of this SDK, so we choose the latest one by - # passing the SDK identifier as QMAKE_MAC_SDK, as reccomended by Apple. - QMAKE_MAC_SDK = $$sdk_identifier -} - -# 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.") -} - -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 = diff --git a/mkspecs/common/xcode.conf b/mkspecs/common/xcode.conf new file mode 100644 index 0000000000..800e2e849c --- /dev/null +++ b/mkspecs/common/xcode.conf @@ -0,0 +1,13 @@ +# +# qmake configuration for Xcode +# + +# Get path of Xcode's Developer directory +QMAKE_XCODE_DEVELOPER_PATH = $$system(xcode-select --print-path) +isEmpty(QMAKE_XCODE_DEVELOPER_PATH): \ + error("Xcode path is not set. Please use xcode-select to choose Xcode installation 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.") + |