summaryrefslogtreecommitdiffstats
path: root/mkspecs/macx-ios-clang/features/resolve_config.prf
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>2015-06-15 17:56:23 +0200
committerTor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>2015-08-04 11:58:05 +0000
commit5d511039f71a110fa757132cdca079e72fe87654 (patch)
tree9c4fb14f3bf3539d3c6d99711f788d7633f03f02 /mkspecs/macx-ios-clang/features/resolve_config.prf
parent44520dfff6fcf50941b13d1b8cf6c81fb94f85af (diff)
iOS: Refactor default_post logic into more appropriate units
The logic was lumped together in one big file. Now that things are more stable and the logic has proven to work over time we can split it out into the more appropriate sub-prfs. Change-Id: I9a40ad72ad9d7550b609e7f50fade1049dfa3ac1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Diffstat (limited to 'mkspecs/macx-ios-clang/features/resolve_config.prf')
-rw-r--r--mkspecs/macx-ios-clang/features/resolve_config.prf64
1 files changed, 64 insertions, 0 deletions
diff --git a/mkspecs/macx-ios-clang/features/resolve_config.prf b/mkspecs/macx-ios-clang/features/resolve_config.prf
new file mode 100644
index 0000000000..d1d3e8ca39
--- /dev/null
+++ b/mkspecs/macx-ios-clang/features/resolve_config.prf
@@ -0,0 +1,64 @@
+
+xcodebuild {
+ # Xcode project files always support both Debug and Release configurations
+ # and iOS device and simulator targets, so we make sure the wrapper-makefile
+ # also does.
+ CONFIG += debug_and_release iphonesimulator_and_iphoneos
+}
+
+load(resolve_config)
+
+CONFIG(iphonesimulator, iphonesimulator|iphoneos): \
+ CONFIG -= iphoneos
+else: \
+ CONFIG -= iphonesimulator
+
+macx-xcode {
+ # There is no way to genereate Xcode projects that are limited to either
+ # simulator or device builds, so iphonesimulator_and_iphoneos is always
+ # effectivly active, even if the user disabled it explicitly.
+ # The Xcode generator doesn't support multiple BUILDS though (exclusive
+ # builds), so we have to manually set up the simulator suffix.
+ library_suffix_iphonesimulator.name = "$${QMAKE_XCODE_LIBRARY_SUFFIX_SETTING}[sdk=iphonesimulator*]"
+ library_suffix_iphonesimulator.value = "_iphonesimulator$($${QMAKE_XCODE_LIBRARY_SUFFIX_SETTING})"
+ QMAKE_MAC_XCODE_SETTINGS += library_suffix_iphonesimulator
+ CONFIG *= xcode_dynamic_library_suffix
+} else {
+ iphonesimulator.name = Simulator
+ iphoneos.name = Device
+ addExclusiveBuilds(iphonesimulator, iphoneos)
+}
+
+equals(TEMPLATE, subdirs) {
+ # Prevent recursion into host_builds
+ for(subdir, SUBDIRS) {
+ contains($${subdir}.CONFIG, host_build) {
+ $${subdir}.CONFIG += no_iphoneos_target no_iphonesimulator_target
+
+ # Other targets which we do want to recurse into may depend on this target,
+ # for example corelib depends on moc, rcc, bootstrap, etc, and other libs
+ # may depend on host-tools that are needed to build the lib, so we resolve
+ # the final target name and redirect it to the base target, so that the
+ # dependency chain is not broken for the other targets.
+
+ !isEmpty($${subdir}.target) {
+ target = $$eval($${subdir}.target)
+ } else {
+ !isEmpty($${subdir}.file): \
+ file = $$eval($${subdir}.file)
+ else: !isEmpty($${subdir}.subdir): \
+ file = $$eval($${subdir}.subdir)
+ else: \
+ file = $$subdir
+
+ target = sub-$$file
+ }
+
+ target ~= s,[^a-zA-Z0-9_],-,
+
+ $${target}-iphonesimulator.depends = $$target
+ $${target}-iphoneos.depends = $$target
+ QMAKE_EXTRA_TARGETS += $${target}-iphonesimulator $${target}-iphoneos
+ }
+ }
+}