diff options
author | Qt4iOS <ian@mediator-software.com> | 2012-03-16 15:00:33 +0000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-26 03:15:22 +0200 |
commit | f9048b3465d163a3c4e12fe6b9261d42a996b314 (patch) | |
tree | b7bc8e41f00bf6ba2f3f28707bb917cae36f2419 /mkspecs/common/ios/arch.conf | |
parent | 5a6ee590a29f0fca0946cd666183b28b390783fa (diff) |
Added mkspecs for iOS.
Modified common MacOS gcc config for iOS compatibility. Added iOS
mkspecs for iOS devices and simulator using G++, LLVM-G++ or CLANG
compilers.
Change-Id: If0a0b1a3ce4e0dc4db319a315e227a9d31549399
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'mkspecs/common/ios/arch.conf')
-rw-r--r-- | mkspecs/common/ios/arch.conf | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/mkspecs/common/ios/arch.conf b/mkspecs/common/ios/arch.conf new file mode 100644 index 0000000000..4ad96874fe --- /dev/null +++ b/mkspecs/common/ios/arch.conf @@ -0,0 +1,84 @@ +# +# Helper to set CPU architecture flags for iOS configurations +# +# Depends on: +# +# QMAKE_IPHONEOS_DEPLOYMENT_TARGET - set in mkspecs/common/ios/versions.conf +# +# Note: +# +# Must be included after load(qt_config) in mkspec for auto-detection based +# on GL/ES version (GL/ES 2.x implies armv7 on iOS). +# + +# Target architecture for iOS devices (armv6, armv7 or leave blank for default) +QMAKE_IOS_TARGET_ARCH = + +########################################################################### + +# Device? +!*simulator* { + # Let mkspec specify archictecture + *armv6*: QMAKE_IOS_TARGET_ARCH = armv6 + else:*armv7*: QMAKE_IOS_TARGET_ARCH = armv7 + + # ARMv7 architecture device (see below) is required for OpenGL/ES 2.x + isEmpty(QMAKE_IOS_TARGET_ARCH):contains(QT_CONFIG, opengles2): QMAKE_IOS_TARGET_ARCH = armv7 + + # No target architecture specified? + isEmpty(QMAKE_IOS_TARGET_ARCH) { + # iOS versions < 4.3 can be armv6 or armv7, so need armv6 for max. compatibility, + # assume that building for OpenGL/ES 1.x is targeting armv6 + lessThan(QMAKE_IPHONEOS_DEPLOYMENT_TARGET, "4.3")|contains(QT_CONFIG, opengles1) { + QMAKE_IOS_TARGET_ARCH = armv6 + } else: QMAKE_IOS_TARGET_ARCH = armv7 + } + + # Samsung S5PC100, Apple A4, A5, A5X + equals(QMAKE_IOS_TARGET_ARCH, "armv7") { + # iOS CPU architecture (armv7) + QMAKE_IOS_ARM_ARCH = __ARM_ARCH_7__ + + # Thumb2 instructions + QMAKE_IOS_ARM_FLAGS = -mthumb + QMAKE_IOS_ARM_ARCH += __MARM_THUMB__ + + # NEON instructions + *-g++*: QMAKE_IOS_ARM_FLAGS += -mfloat-abi=softfp -mfpu=neon + QMAKE_IOS_ARM_ARCH += __ARM_NEON__ + } else { + # Samsung S5L8900 + if(equals(QMAKE_IOS_TARGET_ARCH, "armv6")) { + # iOS CPU architecture (armv6) + QMAKE_IOS_ARM_ARCH = __ARM_ARCH_6__ + + # ARM instructions + QMAKE_IOS_ARM_FLAGS = -marm -mcpu=arm1176jzf-s + !*clang*: QMAKE_IOS_ARM_FLAGS += -march=armv6 + } else { + # Unsupported architecture + error("Invalid iOS target $${QMAKE_IOS_TARGET_ARCH}! Edit mkspecs/common/ios/arch.conf to specify target architecture.") + } + } +# Simulator is i386 only +} else: QMAKE_IOS_TARGET_ARCH = i386 + +# iOS architecture build flags +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 +QMAKE_IOS_TARGET_ARCH = +QMAKE_IOS_ARCH_FLAGS = + +# Architecture specific defines/flags +!*simulator* { + DEFINES += $$QMAKE_IOS_ARM_ARCH + QMAKE_IOS_ARM_ARCH = + + QMAKE_CFLAGS += $$QMAKE_IOS_ARM_FLAGS + QMAKE_CXXFLAGS += $$QMAKE_IOS_ARM_FLAGS + QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_IOS_ARM_FLAGS + QMAKE_IOS_ARM_FLAGS = +} |