From 196f295b928fd67c931b55fde5f6097e4cc3c78f Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 23 Oct 2017 15:42:52 +0200 Subject: Fix shadow prefix framework builds Bundle data source files which don't exist at qmake time need to be handled specially. This also required splitting the generated list of public headers, as was already done for private ones. Task-number: QTBUG-60413 Change-Id: I97acfa88622da6b73839b8f976f73ace3cb10223 Reviewed-by: Oswald Buddenhagen --- mkspecs/features/qt_installs.prf | 2 +- mkspecs/features/qt_module.prf | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'mkspecs') diff --git a/mkspecs/features/qt_installs.prf b/mkspecs/features/qt_installs.prf index 0d3dfb6b93..90d84cc535 100644 --- a/mkspecs/features/qt_installs.prf +++ b/mkspecs/features/qt_installs.prf @@ -32,7 +32,7 @@ qt_install_headers { class_headers.path = $$[QT_INSTALL_HEADERS]/$$MODULE_INCNAME INSTALLS += class_headers - targ_headers.files = $$SYNCQT.HEADER_FILES + targ_headers.files = $$SYNCQT.HEADER_FILES $$SYNCQT.INJECTED_HEADER_FILES targ_headers.path = $$[QT_INSTALL_HEADERS]/$$MODULE_INCNAME INSTALLS += targ_headers diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf index 8a8c17f01b..a5c40a7899 100644 --- a/mkspecs/features/qt_module.prf +++ b/mkspecs/features/qt_module.prf @@ -136,9 +136,17 @@ lib_bundle { if(if(!debug_and_release|CONFIG(release, debug|release))) { FRAMEWORK_HEADERS.version = Versions FRAMEWORK_HEADERS.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES + # Non-existing paths (yet, they will be generated) are used verbatim. + for (injected_header, SYNCQT.INJECTED_HEADER_FILES): \ + FRAMEWORK_HEADERS.files += \ + $$relative_path($$absolute_path($$injected_header, $$_PRO_FILE_PWD_), $$OUT_PWD) + FRAMEWORK_HEADERS.path = Headers FRAMEWORK_PRIVATE_HEADERS.version = Versions - FRAMEWORK_PRIVATE_HEADERS.files = $$SYNCQT.PRIVATE_HEADER_FILES $$SYNCQT.INJECTED_PRIVATE_HEADER_FILES + FRAMEWORK_PRIVATE_HEADERS.files = $$SYNCQT.PRIVATE_HEADER_FILES + for (injected_header, SYNCQT.INJECTED_PRIVATE_HEADER_FILES): \ + FRAMEWORK_PRIVATE_HEADERS.files += \ + $$relative_path($$absolute_path($$injected_header, $$_PRO_FILE_PWD_), $$OUT_PWD) FRAMEWORK_PRIVATE_HEADERS.path = Headers/$$VERSION/$$MODULE_INCNAME/private FRAMEWORK_QPA_HEADERS.version = Versions FRAMEWORK_QPA_HEADERS.files = $$SYNCQT.QPA_HEADER_FILES -- cgit v1.2.3 From 31cc29e9be22a5c09cb90d004d967d524a02408f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 26 Oct 2017 09:32:13 +0200 Subject: Disable Xcode main thread checker by default Xcode 9 introduced the main thread checker, which detects invalid use of AppKit, UIKit, and other APIs from background threads. https://developer.apple.com/documentation/code_diagnostics/main_thread_checker In our case these are accesses to e.g. [UIView layer] and [UIScreen scaleFactor] from the render thread of QtQuick, things we should look at, but that might not be easily solvable. In any case, these are not warnings the user can do anything about, so in lack of a per-library disable of the checker, we have to globally disable it for the whole Xcode project. Task-number: QTBUG-63822 Change-Id: Ibfcdf23891cf6bfbbc9b9b3349e4c256c273c7de Reviewed-by: Eskil Abrahamsen Blomfeldt --- mkspecs/macx-xcode/default.xcscheme | 1 + 1 file changed, 1 insertion(+) (limited to 'mkspecs') diff --git a/mkspecs/macx-xcode/default.xcscheme b/mkspecs/macx-xcode/default.xcscheme index 6beb0d8280..bda2b8c1c0 100644 --- a/mkspecs/macx-xcode/default.xcscheme +++ b/mkspecs/macx-xcode/default.xcscheme @@ -62,6 +62,7 @@ useCustomWorkingDirectory = "NO" buildConfiguration = "Debug" ignoresPersistentStateOnLaunch = "NO" + disableMainThreadChecker = "YES" debugDocumentVersioning = "NO" allowLocationSimulation = "YES"> -- cgit v1.2.3 From 26141086963d1c6ea9451e17c831d748690cf44d Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Mon, 13 Nov 2017 23:55:44 -0800 Subject: qmake: properly filter simulator devices by minimum deployment target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes an issue where a build error may be introduced by a simulator being selected whose OS version is lower than the application's minimum deployment target. Task-number: QTBUG-64456 Change-Id: Ic7c834a1473c183ebb910bc01a416fe1e23a5a14 Reviewed-by: Eike Ziller Reviewed-by: Tor Arne Vestbø --- mkspecs/features/uikit/device_destinations.sh | 6 +- mkspecs/features/uikit/devices.pl | 56 ------------------ mkspecs/features/uikit/devices.py | 82 +++++++++++++++++++++++++++ mkspecs/features/uikit/xcodebuild.mk | 4 +- mkspecs/features/uikit/xcodebuild.prf | 6 +- 5 files changed, 91 insertions(+), 63 deletions(-) delete mode 100755 mkspecs/features/uikit/devices.pl create mode 100755 mkspecs/features/uikit/devices.py (limited to 'mkspecs') diff --git a/mkspecs/features/uikit/device_destinations.sh b/mkspecs/features/uikit/device_destinations.sh index 162ad01aaf..649dd399a7 100755 --- a/mkspecs/features/uikit/device_destinations.sh +++ b/mkspecs/features/uikit/device_destinations.sh @@ -40,10 +40,12 @@ ############################################################################# DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -booted_simulator=$($DIR/devices.pl "$1" "Booted" "NOT unavailable" | tail -n 1) +scheme=$1 +shift +booted_simulator=$($DIR/devices.py --state booted $@ | tail -n 1) echo "SIMULATOR_DEVICES = $booted_simulator" -xcodebuild test -scheme $2 -destination 'id=0' -destination-timeout 1 2>&1| sed -n 's/{ \(platform:.*\) }/\1/p' | while read destination; do +xcodebuild test -scheme $scheme -destination 'id=0' -destination-timeout 1 2>&1| sed -n 's/{ \(platform:.*\) }/\1/p' | while read destination; do id=$(echo $destination | sed -n -E 's/.*id:([^ ,]+).*/\1/p') [[ $id == *"placeholder"* ]] && continue diff --git a/mkspecs/features/uikit/devices.pl b/mkspecs/features/uikit/devices.pl deleted file mode 100755 index 8d69a97273..0000000000 --- a/mkspecs/features/uikit/devices.pl +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/perl - -############################################################################# -## -## Copyright (C) 2017 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is the build configuration utility of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:LGPL$ -## 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 The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://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 3 as published by the Free Software -## Foundation and appearing in the file LICENSE.LGPL3 included in the -## packaging of this file. Please review the following information to -## ensure the GNU Lesser General Public License version 3 requirements -## will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 2.0 or (at your option) the GNU General -## Public license version 3 or any later version approved by the KDE Free -## Qt Foundation. The licenses are as published by the Free Software -## Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-2.0.html and -## https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# - -$output = `xcrun simctl list devices --json 2>&1`; -$output =~ s/\n//g; - -BLOCK: -foreach $block ($output =~ /{.*?}/g) { - foreach $filter (@ARGV) { - if ($filter =~ /^NOT\s(.*)/) { - $block =~ /$1/ && next BLOCK; - } else { - $block =~ /$filter/ || next BLOCK; - } - } - $block =~ /udid[:|\s|\"]+(.*)\"/; - print "$1\n"; -} diff --git a/mkspecs/features/uikit/devices.py b/mkspecs/features/uikit/devices.py new file mode 100755 index 0000000000..0443e838f2 --- /dev/null +++ b/mkspecs/features/uikit/devices.py @@ -0,0 +1,82 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is the build configuration utility of the Qt Toolkit. +## +## $QT_BEGIN_LICENSE:LGPL$ +## 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 The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://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 3 as published by the Free Software +## Foundation and appearing in the file LICENSE.LGPL3 included in the +## packaging of this file. Please review the following information to +## ensure the GNU Lesser General Public License version 3 requirements +## will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 2.0 or (at your option) the GNU General +## Public license version 3 or any later version approved by the KDE Free +## Qt Foundation. The licenses are as published by the Free Software +## Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-2.0.html and +## https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from __future__ import print_function + +import argparse +import json +import subprocess +from distutils.version import StrictVersion + +def is_suitable_runtime(runtimes, runtime_name, platform, min_version): + for runtime in runtimes: + identifier = runtime["identifier"] + if (runtime["name"] == runtime_name or identifier == runtime_name) \ + and "unavailable" not in runtime["availability"] \ + and identifier.startswith("com.apple.CoreSimulator.SimRuntime.{}".format(platform)) \ + and StrictVersion(runtime["version"]) >= min_version: + return True + return False + +def simctl_runtimes(): + return json.loads(subprocess.check_output( + ["/usr/bin/xcrun", "simctl", "list", "runtimes", "--json"]))["runtimes"] + +def simctl_devices(): + return json.loads(subprocess.check_output( + ["/usr/bin/xcrun", "simctl", "list", "devices", "--json"]))["devices"] + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument('--platform', choices=['iOS', 'tvOS', 'watchOS'], required=True) + parser.add_argument('--minimum-deployment-target', type=StrictVersion, default='0.0') + parser.add_argument('--state', + choices=['booted', 'shutdown', 'creating', 'booting', 'shutting-down'], action='append') + args = parser.parse_args() + + runtimes = simctl_runtimes() + device_dict = simctl_devices() + for runtime_name in device_dict: + if is_suitable_runtime(runtimes, runtime_name, args.platform, args.minimum_deployment_target): + for device in device_dict[runtime_name]: + if "unavailable" not in device["availability"] \ + and (args.state is None or device["state"].lower() in args.state): + print(device["udid"]) diff --git a/mkspecs/features/uikit/xcodebuild.mk b/mkspecs/features/uikit/xcodebuild.mk index 0b3ad632b6..435b9dbdf2 100644 --- a/mkspecs/features/uikit/xcodebuild.mk +++ b/mkspecs/features/uikit/xcodebuild.mk @@ -63,7 +63,7 @@ ifneq ($(filter check%,$(MAKECMDGOALS)),) ifeq ($(DEVICES),) $(info Enumerating test destinations (you may override this by setting DEVICES explicitly), please wait...) DESTINATIONS_INCLUDE = /tmp/device_destinations.mk - $(shell $(MAKEFILE_DIR)device_destinations.sh '$(EXPORT_DEVICE_FILTER)' $(TARGET) > $(DESTINATIONS_INCLUDE)) + $(shell $(MAKEFILE_DIR)device_destinations.sh $(TARGET) $(EXPORT_DEVICE_FILTER) > $(DESTINATIONS_INCLUDE)) include $(DESTINATIONS_INCLUDE) endif endif @@ -72,7 +72,7 @@ endif %-device: DEVICES = $(HARDWARE_DEVICES) GENERIC_DEVICE_DESTINATION := $(EXPORT_GENERIC_DEVICE_DESTINATION) -GENERIC_SIMULATOR_DESTINATION := "id=$(shell $(MAKEFILE_DIR)devices.pl '$(EXPORT_DEVICE_FILTER)' "NOT unavailable" | tail -n 1)" +GENERIC_SIMULATOR_DESTINATION := "id=$(shell $(MAKEFILE_DIR)devices.py $(EXPORT_DEVICE_FILTER) | tail -n 1)" %-simulator: DESTINATION = $(if $(DESTINATION_ID),"id=$(DESTINATION_ID)",$(GENERIC_SIMULATOR_DESTINATION)) %-device: DESTINATION = $(if $(DESTINATION_ID),"id=$(DESTINATION_ID)",$(GENERIC_DEVICE_DESTINATION)) diff --git a/mkspecs/features/uikit/xcodebuild.prf b/mkspecs/features/uikit/xcodebuild.prf index a766b9ea5c..7a6b2acfc2 100644 --- a/mkspecs/features/uikit/xcodebuild.prf +++ b/mkspecs/features/uikit/xcodebuild.prf @@ -40,15 +40,15 @@ CONFIG += no_default_goal_deps DEVICE_SDK = $${device.sdk} SIMULATOR_SDK = $${simulator.sdk} ios { - DEVICE_FILTER = "iPhone|iPad" + DEVICE_FILTER = --platform iOS --minimum-deployment-target $$QMAKE_IOS_DEPLOYMENT_TARGET GENERIC_DEVICE_DESTINATION = "generic/platform=iOS" } tvos { - DEVICE_FILTER = "Apple TV" + DEVICE_FILTER = --platform tvOS --minimum-deployment-target $$QMAKE_TVOS_DEPLOYMENT_TARGET GENERIC_DEVICE_DESTINATION = "generic/platform=tvOS" } watchos { - DEVICE_FILTER = "Apple Watch" + DEVICE_FILTER = --platform watchOS --minimum-deployment-target $$QMAKE_WATCHOS_DEPLOYMENT_TARGET GENERIC_DEVICE_DESTINATION = "generic/platform=watchOS" } QMAKE_EXTRA_VARIABLES += DEVICE_SDK SIMULATOR_SDK DEVICE_FILTER GENERIC_DEVICE_DESTINATION -- cgit v1.2.3