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/features | |
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/features')
-rw-r--r-- | mkspecs/features/ios.prf | 25 | ||||
-rw-r--r-- | mkspecs/features/mac/sdk.prf | 10 |
2 files changed, 34 insertions, 1 deletions
diff --git a/mkspecs/features/ios.prf b/mkspecs/features/ios.prf new file mode 100644 index 0000000000..841378e8dd --- /dev/null +++ b/mkspecs/features/ios.prf @@ -0,0 +1,25 @@ +isEmpty(QT_ARCH) { + # The iPhoneOS and iPhoneSimulator targets share the same toolchain, + # so when configure runs the arch tests it passes the correct sysroot, + # but we fail to pick up the architecture since we're not passing -arch + # yet. Xcode does not seem to have a way to run the shared toolchain + # in a way that will automatically do this (for example xcrun -sdk). + contains(QMAKE_MAC_SDK, iphoneos.*): QT_ARCH = armv7 + else: QT_ARCH = i386 # Simulator +} else { + # Fix up the QT_ARCH to be more specific + equals(QT_ARCH, arm) { + # Samsung S5PC100, Apple A4, A5, A5X + QT_ARCH = armv7 + + # FIXME: How do we support armv7s when Qt can't do universal builds? + } +} + +!equals(MAKEFILE_GENERATOR, XCODE) { + arch_flag = -arch $$QT_ARCH + QMAKE_CFLAGS += $$arch_flag + QMAKE_CXXFLAGS += $$arch_flag + QMAKE_OBJECTIVE_CFLAGS += $$arch_flag + QMAKE_LFLAGS += $$arch_flag +} diff --git a/mkspecs/features/mac/sdk.prf b/mkspecs/features/mac/sdk.prf index 4c3e2d2b5a..57dcf7f5eb 100644 --- a/mkspecs/features/mac/sdk.prf +++ b/mkspecs/features/mac/sdk.prf @@ -36,7 +36,15 @@ } !equals(MAKEFILE_GENERATOR, XCODE) { - version_min_flag = -m$${QMAKE_MAC_PLATFORM_NAME}-version-min=$$QMAKE_MACOSX_DEPLOYMENT_TARGET + # FIXME: Get the version_min_flag out of the platform's 'Native Build System.xcspec' + version_identifier = $$replace(QMAKE_MAC_PLATFORM_NAME, iphonesimulator, ios-simulator) + + ios:!host_build: \ + deployment_target = $$QMAKE_IOS_DEPLOYMENT_TARGET + else: \ + deployment_target = $$QMAKE_MACOSX_DEPLOYMENT_TARGET + + version_min_flag = -m$${version_identifier}-version-min=$$deployment_target QMAKE_CFLAGS += $$version_min_flag QMAKE_CXXFLAGS += $$version_min_flag QMAKE_OBJECTIVE_CFLAGS += $$version_min_flag |