summaryrefslogtreecommitdiffstats
path: root/mkspecs/macx-ios-clang
diff options
context:
space:
mode:
Diffstat (limited to 'mkspecs/macx-ios-clang')
-rw-r--r--mkspecs/macx-ios-clang/features/default_post.prf45
-rw-r--r--mkspecs/macx-ios-clang/features/qt.prf16
-rw-r--r--mkspecs/macx-ios-clang/features/sdk.prf29
-rw-r--r--mkspecs/macx-ios-clang/qplatformdefs.h14
-rwxr-xr-xmkspecs/macx-ios-clang/rename_main.sh42
5 files changed, 88 insertions, 58 deletions
diff --git a/mkspecs/macx-ios-clang/features/default_post.prf b/mkspecs/macx-ios-clang/features/default_post.prf
index f1f23dd716..c9d3a5d85b 100644
--- a/mkspecs/macx-ios-clang/features/default_post.prf
+++ b/mkspecs/macx-ios-clang/features/default_post.prf
@@ -1,14 +1,5 @@
-# In case the user sets the SDK manually
-contains(QMAKE_MAC_SDK, ^iphonesimulator.*) {
- iphonesimulator_and_iphoneos: \
- error("iOS simulator is handled automatically for iphonesimulator_and_iphoneos")
-
- CONFIG += iphonesimulator
-}
-
-iphonesimulator_and_iphoneos:iphonesimulator: \
- QMAKE_MAC_SDK ~= s,^iphoneos,iphonesimulator,
+load(sdk)
# Resolve config so we don't need to use CONFIG() later on
CONFIG(iphonesimulator, iphonesimulator|iphoneos) {
@@ -50,7 +41,6 @@ equals(TEMPLATE, app) {
RESOURCES =
INSTALLS =
QMAKE_EXTRA_COMPILERS =
- QMAKE_EXTRA_TARGETS =
!build_pass {
CONFIG += debug_and_release
@@ -76,8 +66,8 @@ equals(TEMPLATE, app) {
args += $$system_quote($$arg)
system("cd $$system_quote($$OUT_PWD) && $$QMAKE_QMAKE $$args $$system_quote($$_PRO_FILE_) -spec macx-xcode")
- check.commands = "$(MAKE) -f $(MAKEFILE).ReleaseSimulator xcode_build_check"
- QMAKE_EXTRA_TARGETS += check
+ # We have a target, even though our template is aux
+ CONFIG += have_target
} else {
load(resolve_config)
@@ -92,10 +82,13 @@ equals(TEMPLATE, app) {
else: \
cfg = release
- for(action, $$list(build install clean)) {
+ for(action, $$list(build install clean test)) {
equals(action, build) {
action_target_suffix =
action_target = all
+ } else: equals(action, test) {
+ action_target_suffix = -check
+ action_target = check
} else {
action_target_suffix = -$$action
action_target = $$action
@@ -103,7 +96,24 @@ equals(TEMPLATE, app) {
target = $${sdk}-$${cfg}$${action_target_suffix}
- $${target}.commands = "@bash -o pipefail -c 'xcodebuild $$action -sdk $$sdk -configuration $$title($$cfg) | grep -v setenv'"
+ xcodebuild = "xcodebuild $$action -scheme $(TARGET) -sdk $$sdk -configuration $$title($$cfg)"
+
+ equals(action, test):equals(sdk, iphoneos) {
+ AVAILABLE_DEVICE_IDS = "$(shell system_profiler SPUSBDataType | sed -n -E -e '/(iPhone|iPad|iPod)/,/Serial/s/ *Serial Number: *(.+)/\1/p')"
+ CUSTOM_DEVICE_IDS = "$(filter $(EXPORT_AVAILABLE_DEVICE_IDS), $(IOS_TEST_DEVICE_IDS))"
+ TEST_DEVICE_IDS = "$(strip $(if $(EXPORT_CUSTOM_DEVICE_IDS), $(EXPORT_CUSTOM_DEVICE_IDS), $(EXPORT_AVAILABLE_DEVICE_IDS)))"
+
+ QMAKE_EXTRA_VARIABLES += AVAILABLE_DEVICE_IDS CUSTOM_DEVICE_IDS TEST_DEVICE_IDS
+
+ xcodebuild = "@$(if $(EXPORT_TEST_DEVICE_IDS),"\
+ "echo Running tests on $(words $(EXPORT_TEST_DEVICE_IDS)) device\\(s\\): && ("\
+ "$(foreach deviceid, $(EXPORT_TEST_DEVICE_IDS),"\
+ "(echo Testing on device ID '$(deviceid)' ... && $${xcodebuild} -destination 'platform=iOS,id=$(deviceid)' && echo) &&"\
+ ") echo Tests completed successfully on all devices"\
+ "), $(error No iOS devices connected, please connect at least one device that can be used for testing.))"
+ }
+
+ $${target}.commands = $$xcodebuild
QMAKE_EXTRA_TARGETS += $$target
$${action_target}.depends += $$target
@@ -115,12 +125,7 @@ equals(TEMPLATE, app) {
QMAKE_EXTRA_TARGETS += xcode_build_dir_distclean
distclean.depends = xcode_build_dir_distclean
QMAKE_EXTRA_TARGETS += distclean
-
- xcode_build_check.commands = "$(TESTRUNNER) $$title($$cfg)-$${sdk}/$(TARGET).app $(TESTARGS)"
- QMAKE_EXTRA_TARGETS += xcode_build_check
}
-
- CONFIG =
}
}
} else: equals(TEMPLATE, lib) {
diff --git a/mkspecs/macx-ios-clang/features/qt.prf b/mkspecs/macx-ios-clang/features/qt.prf
index 7ca3198dbe..9e6b486c6e 100644
--- a/mkspecs/macx-ios-clang/features/qt.prf
+++ b/mkspecs/macx-ios-clang/features/qt.prf
@@ -1,5 +1,6 @@
-equals(TEMPLATE, app):contains(QT, gui(-private)?) {
+qt_depends = $$resolve_depends(QT, "QT.")
+equals(TEMPLATE, app):contains(qt_depends, gui(-private)?) {
LIBS *= -L$$[QT_INSTALL_PLUGINS/get]/platforms
lib_name = qios
@@ -32,19 +33,20 @@ equals(TEMPLATE, app):contains(QT, gui(-private)?) {
# called 'qt_main' now.
macx-xcode {
- objects_dir = "${OBJECT_FILE_DIR}-${CURRENT_VARIANT}"
- archs = "${ARCHS}"
+ objects_dir = "\"${OBJECT_FILE_DIR}-${CURRENT_VARIANT}\""
+ archs = "\"${ARCHS}\""
} else {
- objects_dir = $$OBJECTS_DIR
- isEmpty(objects_dir): \
+ isEmpty(OBJECTS_DIR): \
objects_dir = .
- archs = "$$QMAKE_IOS_DEVICE_ARCHS $$QMAKE_IOS_SIMULATOR_ARCHS"
+ else: \
+ objects_dir = $$shell_quote($$OBJECTS_DIR)
+ archs = $$shell_quote($$QMAKE_IOS_DEVICE_ARCHS $$QMAKE_IOS_SIMULATOR_ARCHS)
}
!isEmpty(QMAKE_PRE_LINK): \
QMAKE_PRE_LINK += ";"
- QMAKE_PRE_LINK += $$QMAKESPEC/rename_main.sh $${objects_dir} \"$${archs}\"
+ QMAKE_PRE_LINK += $$shell_quote($$QMAKESPEC/rename_main.sh) $$objects_dir $$archs
}
}
diff --git a/mkspecs/macx-ios-clang/features/sdk.prf b/mkspecs/macx-ios-clang/features/sdk.prf
index 607a71bb26..32fcbb7289 100644
--- a/mkspecs/macx-ios-clang/features/sdk.prf
+++ b/mkspecs/macx-ios-clang/features/sdk.prf
@@ -1,4 +1,33 @@
+# In case the user sets the SDK manually
+contains(QMAKE_MAC_SDK, ^iphonesimulator.*) {
+ iphonesimulator_and_iphoneos: \
+ error("iOS simulator is handled automatically for iphonesimulator_and_iphoneos")
+
+ CONFIG += iphonesimulator
+}
+
+iphonesimulator_and_iphoneos:iphonesimulator: \
+ QMAKE_MAC_SDK ~= s,^iphoneos,iphonesimulator,
+
load(sdk)
lessThan(QMAKE_MAC_SDK_VERSION, "8.0"): \
error("Current $$QMAKE_MAC_SDK SDK version ($$QMAKE_MAC_SDK_VERSION) is too old. Please upgrade Xcode.")
+
+macx-xcode {
+ sdk_path_iphoneos.name = "QMAKE_MAC_SDK_PATH[sdk=iphoneos*]"
+ sdk_path_iphoneos.value = $$QMAKE_MAC_SDK_PATH
+ QMAKE_MAC_SDK_PATH ~= s,iPhoneOS,iPhoneSimulator,
+ sdk_path_iphonesimulator.name = "QMAKE_MAC_SDK_PATH[sdk=iphonesimulator*]"
+ sdk_path_iphonesimulator.value = $$QMAKE_MAC_SDK_PATH
+ QMAKE_MAC_XCODE_SETTINGS += sdk_path_iphoneos sdk_path_iphonesimulator
+ QMAKE_MAC_SDK_PATH = "$(QMAKE_MAC_SDK_PATH)"
+
+ sdk_platform_path_iphoneos.name = "QMAKE_MAC_SDK_PLATFORM_PATH[sdk=iphoneos*]"
+ sdk_platform_path_iphoneos.value = $$QMAKE_MAC_SDK_PLATFORM_PATH
+ QMAKE_MAC_SDK_PLATFORM_PATH ~= s,iPhoneOS,iPhoneSimulator,
+ sdk_platform_path_iphonesimulator.name = "QMAKE_MAC_SDK_PLATFORM_PATH[sdk=iphonesimulator*]"
+ sdk_platform_path_iphonesimulator.value = $$QMAKE_MAC_SDK_PLATFORM_PATH
+ QMAKE_MAC_XCODE_SETTINGS += sdk_platform_path_iphoneos sdk_platform_path_iphonesimulator
+ QMAKE_MAC_SDK_PLATFORM_PATH = "$(QMAKE_MAC_SDK_PLATFORM_PATH)"
+}
diff --git a/mkspecs/macx-ios-clang/qplatformdefs.h b/mkspecs/macx-ios-clang/qplatformdefs.h
index 3b4f1af832..68020de6d5 100644
--- a/mkspecs/macx-ios-clang/qplatformdefs.h
+++ b/mkspecs/macx-ios-clang/qplatformdefs.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the qmake spec of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/mkspecs/macx-ios-clang/rename_main.sh b/mkspecs/macx-ios-clang/rename_main.sh
index 040140b7ee..1547f5f75c 100755
--- a/mkspecs/macx-ios-clang/rename_main.sh
+++ b/mkspecs/macx-ios-clang/rename_main.sh
@@ -2,41 +2,33 @@
#############################################################################
##
-## Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-## Contact: http://www.qt-project.org/legal
+## Copyright (C) 2015 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
##
## This file is the build configuration utility of the Qt Toolkit.
##
-## $QT_BEGIN_LICENSE:LGPL$
+## $QT_BEGIN_LICENSE:LGPL21$
## Commercial License Usage
## Licensees holding valid commercial Qt licenses may use this file in
## accordance with the commercial license agreement provided with the
## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and Digia. For licensing terms and
-## conditions see http://qt.digia.com/licensing. For further information
-## use the contact form at http://qt.digia.com/contact-us.
+## a written agreement between you and The Qt Company. For licensing terms
+## and conditions see http://www.qt.io/terms-conditions. For further
+## information use the contact form at http://www.qt.io/contact-us.
##
## GNU Lesser General Public License Usage
## Alternatively, this file may be used under the terms of the GNU Lesser
-## General Public License version 2.1 as published by the Free Software
-## Foundation and appearing in the file LICENSE.LGPL included in the
-## packaging of this file. Please review the following information to
-## ensure the GNU Lesser General Public License version 2.1 requirements
-## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+## General Public License version 2.1 or version 3 as published by the Free
+## Software Foundation and appearing in the file LICENSE.LGPLv21 and
+## LICENSE.LGPLv3 included in the packaging of this file. Please review the
+## following information to ensure the GNU Lesser General Public License
+## requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
##
-## In addition, as a special exception, Digia gives you certain additional
-## rights. These rights are described in the Digia Qt LGPL Exception
+## As a special exception, The Qt Company gives you certain additional
+## rights. These rights are described in The Qt Company LGPL Exception
## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3.0 as published by the Free Software
-## Foundation and appearing in the file LICENSE.GPL included in the
-## packaging of this file. Please review the following information to
-## ensure the GNU General Public License version 3.0 requirements will be
-## met: http://www.gnu.org/copyleft/gpl.html.
-##
-##
## $QT_END_LICENSE$
##
#############################################################################
@@ -46,9 +38,11 @@ if [ $# -ne 2 ]; then
else
arch_paths=""
for a in $2; do
- arch_paths="$arch_paths $1/$a"
+ arch_paths="$arch_paths
+$1/$a"
done
- for f in $(find $arch_paths -name '*.o'); do
+ for f in $(IFS="
+"; find $arch_paths -name '*.o'); do
# Skip object files without the _main symbol
nm $f 2>/dev/null | grep -q 'T _main$' || continue