summaryrefslogtreecommitdiffstats
path: root/mkspecs/features
diff options
context:
space:
mode:
Diffstat (limited to 'mkspecs/features')
-rw-r--r--mkspecs/features/ctest_testcase_common.prf26
-rw-r--r--mkspecs/features/mac/mac.prf18
-rw-r--r--mkspecs/features/moc.prf18
-rw-r--r--mkspecs/features/qmltestcase.prf20
-rw-r--r--mkspecs/features/qt_build_config.prf3
-rw-r--r--mkspecs/features/qt_common.prf14
-rw-r--r--mkspecs/features/qt_installs.prf2
-rw-r--r--mkspecs/features/qt_module.prf8
-rw-r--r--mkspecs/features/qt_module_headers.prf30
-rw-r--r--mkspecs/features/simd.prf3
-rw-r--r--mkspecs/features/uic.prf4
-rw-r--r--mkspecs/features/uikit/bitcode.prf2
-rw-r--r--mkspecs/features/uikit/default_post.prf2
-rw-r--r--mkspecs/features/uikit/default_pre.prf4
-rwxr-xr-xmkspecs/features/uikit/device_destinations.sh6
-rwxr-xr-xmkspecs/features/uikit/devices.py (renamed from mkspecs/features/uikit/devices.pl)58
-rw-r--r--mkspecs/features/uikit/watchos_coretext.prf15
-rw-r--r--mkspecs/features/uikit/xcodebuild.mk4
-rw-r--r--mkspecs/features/uikit/xcodebuild.prf6
-rw-r--r--mkspecs/features/unix/separate_debug_info.prf12
20 files changed, 178 insertions, 77 deletions
diff --git a/mkspecs/features/ctest_testcase_common.prf b/mkspecs/features/ctest_testcase_common.prf
index adb9da1b6f..1e3f9d2c1c 100644
--- a/mkspecs/features/ctest_testcase_common.prf
+++ b/mkspecs/features/ctest_testcase_common.prf
@@ -1,6 +1,10 @@
-CMAKE_VERSION = $$system(cmake --version 2>$$QMAKE_SYSTEM_NULL_DEVICE, lines)
-CMAKE_VERSION = $$member(CMAKE_VERSION, 0, 0)
+cmake_version_output = $$system(cmake --version 2>$$QMAKE_SYSTEM_NULL_DEVICE, lines)
+# First line
+cmake_version_output = $$first(cmake_version_output)
+# Format is "cmake version X.Y.Z"
+cmake_version_output = $$split(cmake_version_output)
+CMAKE_VERSION = $$last(cmake_version_output)
check.commands =
QMAKE_EXTRA_TARGETS *= check
@@ -16,23 +20,7 @@ isEmpty(CTEST_VERSION) {
return()
}
-CMAKE_VERSION = $$last(CMAKE_VERSION)
-CMAKE_VERSION_MAJOR = $$section(CMAKE_VERSION, ., 0, 0)
-CMAKE_VERSION_MINOR = $$section(CMAKE_VERSION, ., 1, 1)
-CMAKE_VERSION_PATCH = $$section(CMAKE_VERSION, ., 2, 2)
-# CMake can report versions like 2.8.11-rc1, so strip off the rc part.
-CMAKE_VERSION_PATCH ~= s,-.*,,
-
-VERSION_OK =
-greaterThan(CMAKE_VERSION_MAJOR, 2) {
- VERSION_OK = 1
-} else:greaterThan(CMAKE_VERSION_MAJOR, 1):greaterThan(CMAKE_VERSION_MINOR, 8) {
- VERSION_OK = 1
-} else:greaterThan(CMAKE_VERSION_MAJOR, 1):greaterThan(CMAKE_VERSION_MINOR, 7):greaterThan(CMAKE_VERSION_PATCH, 2) {
- VERSION_OK = 1
-}
-
-isEmpty(VERSION_OK) {
+!versionAtLeast(CMAKE_VERSION, 2.8.3) {
message("cmake $$CMAKE_VERSION is too old for this test.")
return()
}
diff --git a/mkspecs/features/mac/mac.prf b/mkspecs/features/mac/mac.prf
new file mode 100644
index 0000000000..73d8b1208b
--- /dev/null
+++ b/mkspecs/features/mac/mac.prf
@@ -0,0 +1,18 @@
+
+# Embed plist file via linker if we're not building a bundle
+!isEmpty(QMAKE_INFO_PLIST) {
+ add_plist = false
+ equals(TEMPLATE, lib) {
+ plugin:!plugin_bundle: \
+ add_plist = true
+ else: !plugin:!lib_bundle: \
+ add_plist = true
+ } else: equals(TEMPLATE, app) {
+ !app_bundle: \
+ add_plist = true
+ }
+
+ $$add_plist: \
+ QMAKE_LFLAGS += -Wl,-sectcreate,__TEXT,__info_plist,$$shell_quote( \
+ $$relative_path($$absolute_path($$QMAKE_INFO_PLIST, $$_PRO_FILE_PWD_), $$OUT_PWD))
+}
diff --git a/mkspecs/features/moc.prf b/mkspecs/features/moc.prf
index 4f2080ee6f..37194b2eb8 100644
--- a/mkspecs/features/moc.prf
+++ b/mkspecs/features/moc.prf
@@ -76,6 +76,19 @@ silent:moc_header.commands = @echo moc ${QMAKE_FILE_IN} && $$moc_header.commands
QMAKE_EXTRA_COMPILERS += moc_header
INCREDIBUILD_XGE += moc_header
+#moc objc headers
+moc_objc_header.CONFIG = moc_verify
+moc_objc_header.dependency_type = TYPE_C
+moc_objc_header.commands = ${QMAKE_FUNC_mocCmdBase} ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
+moc_objc_header.output = $$MOC_DIR/$${QMAKE_H_MOD_MOC}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJCXX)}
+moc_objc_header.input = OBJECTIVE_HEADERS
+moc_objc_header.variable_out = SOURCES
+moc_objc_header.name = MOC ${QMAKE_FILE_IN}
+moc_objc_header.depends += $$WIN_INCLUDETEMP $$moc_predefs.output
+silent:moc_objc_header.commands = @echo moc ${QMAKE_FILE_IN} && $$moc_objc_header.commands
+QMAKE_EXTRA_COMPILERS += moc_objc_header
+INCREDIBUILD_XGE += moc_objc_header
+
#moc sources
moc_source.CONFIG = no_link moc_verify
moc_source.dependency_type = TYPE_C
@@ -95,14 +108,15 @@ INCLUDEPATH += $$absolute_path($$MOC_DIR, $$OUT_PWD)
!no_mocdepend {
moc_source.depends += $$QMAKE_MOC_EXE
moc_header.depends += $$QMAKE_MOC_EXE
+ moc_objc_header.depends += $$QMAKE_MOC_EXE
}
#generate a mocclean
-build_pass|isEmpty(BUILDS):mocclean.depends = compiler_moc_header_clean compiler_moc_source_clean
+build_pass|isEmpty(BUILDS):mocclean.depends = compiler_moc_header_clean compiler_moc_objc_header_clean compiler_moc_source_clean
else:mocclean.CONFIG += recursive
QMAKE_EXTRA_TARGETS += mocclean
#generate a mocables
-build_pass|isEmpty(BUILDS):mocables.depends = compiler_moc_header_make_all compiler_moc_source_make_all
+build_pass|isEmpty(BUILDS):mocables.depends = compiler_moc_header_make_all compiler_moc_objc_header_make_all compiler_moc_source_make_all
else:mocables.CONFIG += recursive
QMAKE_EXTRA_TARGETS += mocables
diff --git a/mkspecs/features/qmltestcase.prf b/mkspecs/features/qmltestcase.prf
index 335ba90009..4dfec50be8 100644
--- a/mkspecs/features/qmltestcase.prf
+++ b/mkspecs/features/qmltestcase.prf
@@ -1,13 +1,19 @@
-CONFIG += testcase
-
-QT += qml qmltest
-
-mac: CONFIG -= app_bundle
+!isEmpty(SOURCES) {
+ QT += qml qmltest
+ load(testcase)
+ CONFIG -= app_bundle
+ DEFINES += QUICK_TEST_SOURCE_DIR=\"\\\"$$_PRO_FILE_PWD_\\\"\"
+} else {
+ # Allow a project to run tests without a CPP stub
+ TEMPLATE = aux
+ QMAKE_EXTRA_TARGETS += check
+ qtPrepareTool(QMAKE_QMLTESTRUNNER, qmltestrunner)
+ check.commands = $$QMAKE_QMLTESTRUNNER
+}
# If the .pro file specified an IMPORTPATH, then add that to
# the command-line when the test is run.
!isEmpty(IMPORTPATH) {
- load(testcase)
for(import, IMPORTPATH): check.commands += -import \"$$import\"
}
-DEFINES += QUICK_TEST_SOURCE_DIR=\"\\\"$$_PRO_FILE_PWD_\\\"\"
+
diff --git a/mkspecs/features/qt_build_config.prf b/mkspecs/features/qt_build_config.prf
index 150d2b2cc3..76e1d15319 100644
--- a/mkspecs/features/qt_build_config.prf
+++ b/mkspecs/features/qt_build_config.prf
@@ -100,6 +100,9 @@ unix: CONFIG += explicitlib
# By default we want tests on macOS to be built as standalone executables
macos: CONFIG += testcase_no_bundle
+# Override MinGW's definition in _mingw.h
+mingw: DEFINES += WINVER=0x0601 _WIN32_WINNT=0x0601
+
defineTest(qtBuildPart) {
bp = $$eval($$upper($$section(_QMAKE_CONF_, /, -2, -2))_BUILD_PARTS)
isEmpty(bp): bp = $$QT_BUILD_PARTS
diff --git a/mkspecs/features/qt_common.prf b/mkspecs/features/qt_common.prf
index fb96d1b6a0..f4ae5bde80 100644
--- a/mkspecs/features/qt_common.prf
+++ b/mkspecs/features/qt_common.prf
@@ -55,10 +55,18 @@ host_build:cross_compile: return()
# -Wdate-time: warn if we use __DATE__ or __TIME__ (we want to be able to reproduce the exact same binary)
# -Wvla: use of variable-length arrays (an extension to C++)
clang {
- # Clang 3.5 introduced -Wdate-time
- # The conditional assumes we aren't compiling against Clang 2.x anymore
- greaterThan(QT_CLANG_MAJOR_VERSION, 3)|greaterThan(QT_CLANG_MINOR_VERSION, 4): \
+ clang_ver = $${QT_CLANG_MAJOR_VERSION}.$${QT_CLANG_MINOR_VERSION}
+ versionAtLeast(clang_ver, 3.5): \
QMAKE_CXXFLAGS_WARN_ON += -Wdate-time
+
+ # Clang/LLVM 5.0 and Xcode 9.0 introduced unguarded availability warnings.
+ # The same construct has been a hard error in Swift from the very beginning.
+ apple_ver = $${QT_APPLE_CLANG_MAJOR_VERSION}.$${QT_APPLE_CLANG_MINOR_VERSION}
+ darwin:if(versionAtLeast(clang_ver, 5.0)|versionAtLeast(apple_ver, 9.0)): \
+ QMAKE_CXXFLAGS_WARN_ON += \
+ -Werror=unguarded-availability \
+ -Werror=unguarded-availability-new \
+ -Werror=unsupported-availability-guard
} else: gcc:!intel_icc {
QMAKE_CXXFLAGS_WARN_ON += -Wvla
# GCC 5 introduced -Wdate-time
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 36f632e8ca..c0a8dcc251 100644
--- a/mkspecs/features/qt_module.prf
+++ b/mkspecs/features/qt_module.prf
@@ -135,10 +135,12 @@ lib_bundle {
!build_all| \
if(if(!debug_and_release|CONFIG(release, debug|release))) {
FRAMEWORK_HEADERS.version = Versions
- FRAMEWORK_HEADERS.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES
+ FRAMEWORK_HEADERS.files = \
+ $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES $$SYNCQT.INJECTED_HEADER_FILES
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 $$SYNCQT.INJECTED_PRIVATE_HEADER_FILES
FRAMEWORK_PRIVATE_HEADERS.path = Headers/$$VERSION/$$MODULE_INCNAME/private
FRAMEWORK_QPA_HEADERS.version = Versions
FRAMEWORK_QPA_HEADERS.files = $$SYNCQT.QPA_HEADER_FILES
@@ -195,7 +197,7 @@ sse2:!contains(QT_CPU_FEATURES.$$QT_ARCH, sse2):!host_build:!if(static:qtConfig(
clang {
apple_clang_ver = $${QT_APPLE_CLANG_MAJOR_VERSION}.$${QT_APPLE_CLANG_MINOR_VERSION}
reg_clang_ver = $${QT_CLANG_MAJOR_VERSION}.$${QT_CLANG_MINOR_VERSION}
- !lessThan(apple_clang_ver, "5.1")|!lessThan(reg_clang_ver, "3.4"): \
+ versionAtLeast(apple_clang_ver, 5.1)|versionAtLeast(reg_clang_ver, 3.4): \
CONFIG += compiler_supports_fpmath
} else: gcc {
CONFIG += compiler_supports_fpmath
diff --git a/mkspecs/features/qt_module_headers.prf b/mkspecs/features/qt_module_headers.prf
index 8837410b8d..931a26f5ae 100644
--- a/mkspecs/features/qt_module_headers.prf
+++ b/mkspecs/features/qt_module_headers.prf
@@ -121,18 +121,19 @@ exists($$OUT_PWD/qt$${MODULE}-config.h) {
for (injection, SYNCQT.INJECTIONS) {
injects = $$split(injection, :)
dst_hdr = $$absolute_path($$member(injects, 0), $$MODULE_INC_OUTDIR)
- fwd_hdr = $$member(injects, 1)
+ ofwd_hdr = $$member(injects, 1)
+ fwd_hdr = $$replace(ofwd_hdr, ^\\^, )
MAIN_FWD = $$MODULE_INC_OUTDIR/$$fwd_hdr
MAIN_FWD_CONT = '$${LITERAL_HASH}include "$$relative_path($$dst_hdr, $$dirname(MAIN_FWD))"'
write_file($$MAIN_FWD, MAIN_FWD_CONT)|error()
- touch($$MAIN_FWD, $$dst_hdr)
+ equals(fwd_hdr, ofwd_hdr): touch($$MAIN_FWD, $$dst_hdr)
!git_build: QMAKE_DISTCLEAN += $$MAIN_FWD
injects = $$member(injects, 2, -1)
for (inject, injects) {
CLASS_FWD = $$MODULE_INC_OUTDIR/$$inject
CLASS_FWD_CONT = '$${LITERAL_HASH}include "$$fwd_hdr"'
write_file($$CLASS_FWD, CLASS_FWD_CONT)|error()
- touch($$CLASS_FWD, $$dst_hdr)
+ touch($$CLASS_FWD, $$MAIN_FWD)
!git_build: QMAKE_DISTCLEAN += $$CLASS_FWD
}
}
@@ -213,20 +214,16 @@ headersclean:!internal_module {
!contains(QT_ARCH, arm):!contains(QT_ARCH, mips): \
hcleanFLAGS += -Wcast-align
- greaterThan(QT_CLANG_MAJOR_VERSION, 3) {
- hcleanFLAGS += -Wdouble-promotion
- } greaterThan(QT_CLANG_MAJOR_VERSION, 2):greaterThan(QT_CLANG_MINOR_VERSION, 7) {
- hcleanFLAGS += -Wdouble-promotion
- }
+ clang_ver = $${QT_CLANG_MAJOR_VERSION}.$${QT_CLANG_MINOR_VERSION}
+ versionAtLeast(clang_ver, 3.8): hcleanFLAGS += -Wdouble-promotion
!clang {
# options accepted only by GCC
- greaterThan(QT_GCC_MAJOR_VERSION, 4) {
- hcleanFLAGS += -Wdouble-promotion
- } greaterThan(QT_GCC_MAJOR_VERSION, 3):greaterThan(QT_GCC_MINOR_VERSION, 4) {
- hcleanFLAGS += -Wdouble-promotion
- }
+ gcc_ver = $${QT_GCC_MAJOR_VERSION}.$${QT_GCC_MINOR_VERSION}
+ versionAtLeast(gcc_ver, 4.5): hcleanFLAGS += -Wdouble-promotion
+ versionAtLeast(gcc_ver, 4.9): hcleanFLAGS += -Wfloat-conversion
+
c++11 {
# only enabled for actual c++11 builds due to
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52806
@@ -252,12 +249,17 @@ headersclean:!internal_module {
}
hcleanCOMMAND = $$QMAKE_CXX -c $(CXXFLAGS) $$hcleanFLAGS $(INCPATH) $$hcleanDEFS -xc++ ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
- } else: win32-msvc2013 {
+ } else: msvc:!intel_icl {
# 4180: qualifier applied to function type has no meaning; ignored
# 4458: declaration of 'identifier' hides class member
# -Za enables strict standards behavior, but we can't add it because
# <windows.h> and <GL.h> violate the standards.
hcleanFLAGS = -WX -W3 -wd4180 -wd4458
+
+ # MSVC 2015 (compiler version 19.0):
+ # 4577: 'noexcept' used with no exception handling mode specified; termination on exception is not guaranteed. Specify /EHsc
+ greaterThan(QMAKE_MSC_VER, 18): hcleanFLAGS += -wd4577
+
hcleanCOMMAND = $$QMAKE_CXX -c $(CXXFLAGS) $$hcleanFLAGS $(INCPATH) $$hcleanDEFS -FI${QMAKE_FILE_IN} -Fo${QMAKE_FILE_OUT} \
$$[QT_INSTALL_DATA/src]/mkspecs/features/data/dummy.cpp
}
diff --git a/mkspecs/features/simd.prf b/mkspecs/features/simd.prf
index 953fc52c65..8471ce7e7c 100644
--- a/mkspecs/features/simd.prf
+++ b/mkspecs/features/simd.prf
@@ -93,6 +93,8 @@ addSimdCompiler(sse3)
addSimdCompiler(ssse3)
addSimdCompiler(sse4_1)
addSimdCompiler(sse4_2)
+addSimdCompiler(aesni)
+addSimdCompiler(shani)
addSimdCompiler(avx)
addSimdCompiler(avx2)
addSimdCompiler(avx512f)
@@ -105,6 +107,7 @@ addSimdCompiler(avx512vl)
addSimdCompiler(avx512ifma)
addSimdCompiler(avx512vbmi)
addSimdCompiler(f16c)
+addSimdCompiler(rdrnd)
addSimdCompiler(neon)
addSimdCompiler(mips_dsp)
addSimdCompiler(mips_dspr2)
diff --git a/mkspecs/features/uic.prf b/mkspecs/features/uic.prf
index ca8283920a..134d3b4acb 100644
--- a/mkspecs/features/uic.prf
+++ b/mkspecs/features/uic.prf
@@ -3,8 +3,10 @@ qtPrepareTool(QMAKE_UIC, uic, _DEP)
isEmpty(UI_DIR):UI_DIR = .
isEmpty(QMAKE_MOD_UIC):QMAKE_MOD_UIC = ui_
+contains(TEMPLATE, .*lib):dll: QMAKE_UIC_FLAGS += -no-stringliteral
+
uic.depends += $$QMAKE_UIC_EXE
-uic.commands = $$QMAKE_UIC ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
+uic.commands = $$QMAKE_UIC $$QMAKE_UIC_FLAGS ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
uic.depend_command = $$QMAKE_UIC_DEP -d ${QMAKE_FILE_IN}
uic.output = $$UI_DIR/$${QMAKE_MOD_UIC}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)}
uic.input = FORMS
diff --git a/mkspecs/features/uikit/bitcode.prf b/mkspecs/features/uikit/bitcode.prf
index df298171c0..f1fd33981a 100644
--- a/mkspecs/features/uikit/bitcode.prf
+++ b/mkspecs/features/uikit/bitcode.prf
@@ -1,4 +1,4 @@
-lessThan(QMAKE_XCODE_VERSION, "7.0") {
+!versionAtLeast(QMAKE_XCODE_VERSION, 7.0) {
warning("You need to update Xcode to version 7 or newer to support bitcode")
} else: !macx-xcode {
# Simulator builds and all debug builds SHOULD use -fembed-bitcode-marker,
diff --git a/mkspecs/features/uikit/default_post.prf b/mkspecs/features/uikit/default_post.prf
index f7245e48b1..c1b6f38a6c 100644
--- a/mkspecs/features/uikit/default_post.prf
+++ b/mkspecs/features/uikit/default_post.prf
@@ -39,7 +39,7 @@ macx-xcode {
qmake_launch_images.files = $$qmake_copy_image.output
QMAKE_BUNDLE_DATA += qmake_launch_images
- lessThan(QMAKE_XCODE_VERSION, "6.0") {
+ !versionAtLeast(QMAKE_XCODE_VERSION, 6.0) {
warning("You need to update Xcode to version 6 or newer to fully support iPhone6/6+")
} else {
# Set up default LaunchScreen to support iPhone6/6+
diff --git a/mkspecs/features/uikit/default_pre.prf b/mkspecs/features/uikit/default_pre.prf
index 00e29a5c8b..6a44a67bca 100644
--- a/mkspecs/features/uikit/default_pre.prf
+++ b/mkspecs/features/uikit/default_pre.prf
@@ -21,8 +21,8 @@ unset(sim_and_dev)
load(default_pre)
# Check for supported Xcode versions
-lessThan(QMAKE_XCODE_VERSION, "4.3"): \
+!versionAtLeast(QMAKE_XCODE_VERSION, 4.3): \
error("This mkspec requires Xcode 4.3 or later")
-ios:shared:lessThan(QMAKE_IOS_DEPLOYMENT_TARGET, "8.0"): \
+ios:shared:!versionAtLeast(QMAKE_IOS_DEPLOYMENT_TARGET, 8.0): \
QMAKE_IOS_DEPLOYMENT_TARGET = 8.0
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.py
index 8d69a97273..0443e838f2 100755
--- a/mkspecs/features/uikit/devices.pl
+++ b/mkspecs/features/uikit/devices.py
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/python
#############################################################################
##
@@ -39,18 +39,44 @@
##
#############################################################################
-$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";
-}
+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/watchos_coretext.prf b/mkspecs/features/uikit/watchos_coretext.prf
new file mode 100644
index 0000000000..30e5af2e7e
--- /dev/null
+++ b/mkspecs/features/uikit/watchos_coretext.prf
@@ -0,0 +1,15 @@
+# CoreText is documented to be available on watchOS, but the headers aren't present
+# in the watchOS Simulator SDK like they are supposed to be. Work around the problem
+# by adding the device SDK's headers to the search path as a fallback.
+# rdar://25314492, rdar://27844864
+simulator_system_frameworks = $$xcodeSDKInfo(Path, $${simulator.sdk})/System/Library/Frameworks
+watchos:simulator:!exists($$simulator_system_frameworks/CoreText.framework/Headers/CoreText.h) {
+ device_system_frameworks = $$xcodeSDKInfo(Path, $${device.sdk})/System/Library/Frameworks
+ for (arch, QMAKE_APPLE_SIMULATOR_ARCHS) {
+ QMAKE_CXXFLAGS += \
+ -Xarch_$${arch} \
+ -F$$simulator_system_frameworks \
+ -Xarch_$${arch} \
+ -F$$device_system_frameworks
+ }
+}
diff --git a/mkspecs/features/uikit/xcodebuild.mk b/mkspecs/features/uikit/xcodebuild.mk
index 7d3275df65..0c8d99f4b8 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
diff --git a/mkspecs/features/unix/separate_debug_info.prf b/mkspecs/features/unix/separate_debug_info.prf
index ebb37bdfc7..0b34b17c27 100644
--- a/mkspecs/features/unix/separate_debug_info.prf
+++ b/mkspecs/features/unix/separate_debug_info.prf
@@ -56,6 +56,13 @@ have_target:!static:if(darwin|!isEmpty(QMAKE_OBJCOPY)) {
debug_info_plist.input = $$QMAKESPEC/Info.plist.dSYM.in
debug_info_plist.output = $${debug_info_target}.$$debug_info_suffix/Contents/Info.plist
QMAKE_SUBSTITUTES += debug_info_plist
+
+ !isEmpty(QMAKE_DSYM_DEBUG_SCRIPT) {
+ debug_script.input = $$QMAKE_DSYM_DEBUG_SCRIPT
+ debug_script.output = $${debug_info_target}.$$debug_info_suffix/Contents/Resources/Python/$${TARGET}.py
+ debug_script.CONFIG = verbatim
+ QMAKE_SUBSTITUTES += debug_script
+ }
}
contains(INSTALLS, target):isEmpty(target.files):isEmpty(target.commands):isEmpty(target.extra) {
@@ -64,6 +71,11 @@ have_target:!static:if(darwin|!isEmpty(QMAKE_OBJCOPY)) {
debug_info_plist_target.files = $${debug_info_target}.$$debug_info_suffix/Contents/Info.plist
debug_info_plist_target.path += $${target.path}/$${debug_info_target_rel}.$$debug_info_suffix/Contents
INSTALLS += debug_info_plist_target
+
+ debug_script_target.CONFIG += no_check_exist
+ debug_script_target.files = $${debug_info_target}.$$debug_info_suffix/Contents/Resources/Python/$${TARGET}.py
+ debug_script_target.path += $${target.path}/$${debug_info_target_rel}.$$debug_info_suffix/Contents/Resources/Python
+ INSTALLS += debug_script_target
}
debug_info_target.CONFIG += no_check_exist