diff options
Diffstat (limited to 'mkspecs/features')
-rw-r--r-- | mkspecs/features/configure.prf | 4 | ||||
-rw-r--r-- | mkspecs/features/data/unix/findclasslist.pl | 34 | ||||
-rw-r--r-- | mkspecs/features/default_post.prf | 18 | ||||
-rw-r--r-- | mkspecs/features/device_config.prf | 15 | ||||
-rw-r--r-- | mkspecs/features/java.prf | 2 | ||||
-rw-r--r-- | mkspecs/features/mac/sdk.prf | 56 | ||||
-rw-r--r-- | mkspecs/features/qml_module.prf | 20 | ||||
-rw-r--r-- | mkspecs/features/qt.prf | 4 | ||||
-rw-r--r-- | mkspecs/features/qt_common.prf | 15 | ||||
-rw-r--r-- | mkspecs/features/qt_functions.prf | 5 | ||||
-rw-r--r-- | mkspecs/features/qt_module_headers.prf | 5 | ||||
-rw-r--r-- | mkspecs/features/qt_module_pris.prf | 2 | ||||
-rw-r--r-- | mkspecs/features/qt_tool.prf | 49 | ||||
-rw-r--r-- | mkspecs/features/simd.prf | 41 | ||||
-rw-r--r-- | mkspecs/features/testcase.prf | 15 |
15 files changed, 181 insertions, 104 deletions
diff --git a/mkspecs/features/configure.prf b/mkspecs/features/configure.prf index 6b37a04450..92c288cdb6 100644 --- a/mkspecs/features/configure.prf +++ b/mkspecs/features/configure.prf @@ -67,7 +67,9 @@ defineTest(qtCompileTest) { mkpath($$test_out_dir)|error("Aborting.") - qtRunLoggedCommand("$$test_cmd_base $$system_quote($$system_path($$QMAKE_QMAKE)) -spec $$QMAKESPEC $$qmake_configs $$shell_quote($$test_dir)") { + !isEmpty (QMAKE_QTCONF): qtconfarg = -qtconf $$QMAKE_QTCONF + + qtRunLoggedCommand("$$test_cmd_base $$system_quote($$system_path($$QMAKE_QMAKE)) $$qtconfarg -spec $$QMAKESPEC $$qmake_configs $$shell_quote($$test_dir)") { qtRunLoggedCommand("$$test_cmd_base $$QMAKE_MAKE") { log("yes$$escape_expand(\\n)") msg = "test $$1 succeeded" diff --git a/mkspecs/features/data/unix/findclasslist.pl b/mkspecs/features/data/unix/findclasslist.pl index adec22d58d..fb4357d0d4 100644 --- a/mkspecs/features/data/unix/findclasslist.pl +++ b/mkspecs/features/data/unix/findclasslist.pl @@ -1,32 +1,38 @@ #!/usr/bin/env perl ############################################################################# ## -## Copyright (C) 2016 Intel Corporation -## Contact: http://www.qt.io/licensing/ +## Copyright (C) 2016 Intel Corporation. +## Contact: https://www.qt.io/licensing/ ## ## This file is part of the build configuration tools of the Qt Toolkit. ## -## $QT_BEGIN_LICENSE:LGPL21$ +## $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 http://www.qt.io/terms-conditions. For further -## information use the contact form at http://www.qt.io/contact-us. +## 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 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. +## 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. ## -## 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 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$ ## diff --git a/mkspecs/features/default_post.prf b/mkspecs/features/default_post.prf index 561c8f4858..e7e9a5bd87 100644 --- a/mkspecs/features/default_post.prf +++ b/mkspecs/features/default_post.prf @@ -95,13 +95,17 @@ breakpad { !isEmpty(QMAKE_STRIP):QMAKE_POST_LINK = $$QMAKE_POST_LINK$$escape_expand(\\n\\t)$$quote($$QMAKE_STRIP $$DEBUGFILENAME) } -# Disable special compiler flags for host builds (needs to be changed for 5.7 -# to fall back to c++11 because since 5.7 c++11 is required everywhere, -# including host builds). -if(!host_build|!cross_compile):if(c++11|c++14|c++1z) { - c++1z: cxxstd = CXX1Z - else: c++14: cxxstd = CXX14 - else: cxxstd = CXX11 +c++11|c++14|c++1z { + # Disable special compiler flags for host builds + !host_build|!cross_compile { + c++1z: cxxstd = CXX1Z + else: c++14: cxxstd = CXX14 + else: cxxstd = CXX11 + } else { + # Fall back to c++11, because since 5.7 c++11 is required everywhere, + # including host builds + cxxstd = CXX11 + } # Check if we should disable the GNU extensions or not !strict_c++:!isEmpty(QMAKE_CXXFLAGS_GNU$$cxxstd): cxxstd = GNU$$cxxstd diff --git a/mkspecs/features/device_config.prf b/mkspecs/features/device_config.prf index e0383ef530..9281d3e407 100644 --- a/mkspecs/features/device_config.prf +++ b/mkspecs/features/device_config.prf @@ -1,16 +1,15 @@ # This file is loaded by some qmakespecs to get early configuration data. -# Load generated qdevice.pri -DEVICE_PRI = $$[QT_HOST_DATA/get]/mkspecs/qdevice.pri +host_build: \ + PRI_FILE_NAME = qhost.pri +else: \ + PRI_FILE_NAME = qdevice.pri +DEVICE_PRI = $$[QT_HOST_DATA/get]/mkspecs/$$PRI_FILE_NAME exists($$DEVICE_PRI):include($$DEVICE_PRI) unset(DEVICE_PRI) -host_build { - CROSS_COMPILE = -} else: isEmpty(CROSS_COMPILE) { - #this variable can be persisted via qmake -set CROSS_COMPILE /foo - CROSS_COMPILE = $$[CROSS_COMPILE] -} +# this variable can be persisted via qmake -set CROSS_COMPILE /foo +!host_build:isEmpty(CROSS_COMPILE): CROSS_COMPILE = $$[CROSS_COMPILE] # Provide a function to be used by mkspecs defineTest(deviceSanityCheckCompiler) { diff --git a/mkspecs/features/java.prf b/mkspecs/features/java.prf index 1b9754da8a..54dced2865 100644 --- a/mkspecs/features/java.prf +++ b/mkspecs/features/java.prf @@ -2,7 +2,7 @@ TEMPLATE = lib android { API_VERSION_TO_USE = $$(ANDROID_API_VERSION) isEmpty(API_VERSION_TO_USE): API_VERSION_TO_USE = $$API_VERSION - isEmpty(API_VERSION_TO_USE): API_VERSION_TO_USE = android-10 + isEmpty(API_VERSION_TO_USE): API_VERSION_TO_USE = android-16 ANDROID_JAR_FILE = $$ANDROID_SDK_ROOT/platforms/$$API_VERSION_TO_USE/android.jar !exists($$ANDROID_JAR_FILE) { diff --git a/mkspecs/features/mac/sdk.prf b/mkspecs/features/mac/sdk.prf index 210843bd94..ab37b1740f 100644 --- a/mkspecs/features/mac/sdk.prf +++ b/mkspecs/features/mac/sdk.prf @@ -5,29 +5,24 @@ isEmpty(QMAKE_MAC_SDK): \ contains(QMAKE_MAC_SDK, .*/.*): \ error("QMAKE_MAC_SDK can only contain short-form SDK names (eg. macosx, iphoneos)") -isEmpty(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.path) { - QMAKE_MAC_SDK_PATH = $$system("/usr/bin/xcodebuild -sdk $$QMAKE_MAC_SDK -version Path 2>/dev/null") - isEmpty(QMAKE_MAC_SDK_PATH): error("Could not resolve SDK path for \'$$QMAKE_MAC_SDK\'") - cache(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.path, set stash, QMAKE_MAC_SDK_PATH) -} else { - QMAKE_MAC_SDK_PATH = $$eval(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.path) -} +defineReplace(xcodeSDKInfo) { + info = $$1 + sdk = $$2 + isEmpty(sdk): \ + sdk = $$QMAKE_MAC_SDK + + isEmpty(QMAKE_MAC_SDK.$${sdk}.$${info}) { + QMAKE_MAC_SDK.$${sdk}.$${info} = $$system("/usr/bin/xcodebuild -sdk $$sdk -version $$info 2>/dev/null") + isEmpty(QMAKE_MAC_SDK.$${sdk}.$${info}): error("Could not resolve SDK $$info for \'$$sdk\'") + cache(QMAKE_MAC_SDK.$${sdk}.$${info}, set stash, QMAKE_MAC_SDK.$${sdk}.$${info}) + } -isEmpty(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.platform_path) { - QMAKE_MAC_SDK_PLATFORM_PATH = $$system("/usr/bin/xcodebuild -sdk $$QMAKE_MAC_SDK -version PlatformPath 2>/dev/null") - isEmpty(QMAKE_MAC_SDK_PLATFORM_PATH): error("Could not resolve SDK platform path for \'$$QMAKE_MAC_SDK\'") - cache(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.platform_path, set stash, QMAKE_MAC_SDK_PLATFORM_PATH) -} else { - QMAKE_MAC_SDK_PLATFORM_PATH = $$eval(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.platform_path) + return($$eval(QMAKE_MAC_SDK.$${sdk}.$${info})) } -isEmpty(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.version) { - QMAKE_MAC_SDK_VERSION = $$system("/usr/bin/xcodebuild -sdk $$QMAKE_MAC_SDK -version SDKVersion 2>/dev/null") - isEmpty(QMAKE_MAC_SDK_VERSION): error("Could not resolve SDK version for \'$$QMAKE_MAC_SDK\'") - cache(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.version, set stash, QMAKE_MAC_SDK_VERSION) -} else { - QMAKE_MAC_SDK_VERSION = $$eval(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.version) -} +QMAKE_MAC_SDK_PATH = $$xcodeSDKInfo(Path) +QMAKE_MAC_SDK_PLATFORM_PATH = $$xcodeSDKInfo(PlatformPath) +QMAKE_MAC_SDK_VERSION = $$xcodeSDKInfo(SDKVersion) !equals(MAKEFILE_GENERATOR, XCODE) { QMAKE_CFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH @@ -59,22 +54,17 @@ for(tool, $$list(QMAKE_CC QMAKE_CXX QMAKE_FIX_RPATH QMAKE_AR QMAKE_RANLIB QMAKE_ cache($$tool_variable, set stash, $$tool) } -isEmpty(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.platform_name) { - QMAKE_MAC_PLATFORM_NAME = $$system("/usr/libexec/PlistBuddy -c 'print DefaultProperties:PLATFORM_NAME' $$QMAKE_MAC_SDK_PATH/SDKSettings.plist 2>/dev/null") - isEmpty(QMAKE_MAC_PLATFORM_NAME): error("Could not resolve platform name for SDK '$$QMAKE_MAC_SDK'") - cache(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.platform_name, set stash, QMAKE_MAC_PLATFORM_NAME) -} else { - QMAKE_MAC_PLATFORM_NAME = $$eval(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.platform_name) -} - !equals(MAKEFILE_GENERATOR, XCODE) { - # FIXME: Get the version_min_flag out of the platform's 'Native Build System.xcspec' - version_identifier = $$replace(QMAKE_MAC_PLATFORM_NAME, iphonesimulator, ios-simulator) - - ios:!host_build: \ + ios:!host_buildĀ { + simulator: \ + version_identifier = $$simulator.deployment_identifier + else: \ + version_identifier = $$device.deployment_identifier deployment_target = $$QMAKE_IOS_DEPLOYMENT_TARGET - else: \ + } else: osx { + version_identifier = macosx deployment_target = $$QMAKE_MACOSX_DEPLOYMENT_TARGET + } version_min_flag = -m$${version_identifier}-version-min=$$deployment_target QMAKE_CFLAGS += $$version_min_flag diff --git a/mkspecs/features/qml_module.prf b/mkspecs/features/qml_module.prf index e71543e244..2115b39c04 100644 --- a/mkspecs/features/qml_module.prf +++ b/mkspecs/features/qml_module.prf @@ -13,7 +13,8 @@ equals(TEMPLATE, app): TEMPLATE = aux isEmpty(TARGETPATH): error("Must set TARGETPATH (QML import name)") -fq_qml_files = $$_PRO_FILE_PWD_/qmldir +qmldir_file = $$_PRO_FILE_PWD_/qmldir +fq_qml_files = $$qmldir_file for(qmlf, QML_FILES): fq_qml_files += $$absolute_path($$qmlf, $$_PRO_FILE_PWD_) @@ -25,6 +26,8 @@ qml1_target: \ else: \ instbase = $$[QT_INSTALL_QML] +!qml1_target:static: CONFIG += builtin_resources + !force_independent:if(!debug_and_release|!build_all|CONFIG(release, debug|release)) { # These bizarre rules copy the files to the qtbase build directory @@ -32,7 +35,8 @@ else: \ return($$relative_path($$1, $$_PRO_FILE_PWD_)) } - qmlfiles2build.input = fq_qml_files + !builtin_resources: qmlfiles2build.input = fq_qml_files + else: qmlfiles2build.input = qmldir_file qmlfiles2build.output = $$instbase/$$TARGETPATH/${QMAKE_FUNC_FILE_IN_qmlModStripSrcDir} !contains(TEMPLATE, vc.*): qmlfiles2build.variable_out = PRE_TARGETDEPS qmlfiles2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} @@ -42,8 +46,18 @@ else: \ QMAKE_EXTRA_COMPILERS += qmlfiles2build } +builtin_resources { + URITARGET = $$replace(URI, "\\.", "_") + # Ensure the qml files are included in the resources + $${URITARGET}.files = $$fq_qml_files + # qt-project.org/imports is the path used for locating imports inside the resources + $${URITARGET}.prefix = /qt-project.org/imports/$$TARGETPATH + RESOURCES += $${URITARGET} +} + # Install rules qmldir.base = $$_PRO_FILE_PWD_ -qmldir.files = $$fq_qml_files +!builtin_resources: qmldir.files = $$fq_qml_files +else: qmldir.files = $$qmldir_file qmldir.path = $$instbase/$$TARGETPATH INSTALLS += qmldir diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf index f62b6bb139..4b40451c96 100644 --- a/mkspecs/features/qt.prf +++ b/mkspecs/features/qt.prf @@ -243,7 +243,7 @@ contains(qt_module_deps, qml): \ } QML_IMPORT_CPP = $$OUT_PWD/$$lower($$basename(TARGET))_qml_plugin_import.cpp write_file($$QML_IMPORT_CPP, IMPORT_FILE_CONT)|error("Aborting.") - SOURCES += $$QML_IMPORT_CPP + GENERATED_SOURCES += $$QML_IMPORT_CPP QMAKE_DISTCLEAN += $$QML_IMPORT_CPP # copy qml files. this part is platform spesific. @@ -339,7 +339,7 @@ contains(QT_CONFIG, static) { } IMPORT_CPP = $$OUT_PWD/$$lower($$basename(TARGET))_plugin_import.cpp write_file($$IMPORT_CPP, IMPORT_FILE_CONT)|error("Aborting.") - SOURCES += $$IMPORT_CPP + GENERATED_SOURCES += $$IMPORT_CPP QMAKE_DISTCLEAN += $$IMPORT_CPP } } diff --git a/mkspecs/features/qt_common.prf b/mkspecs/features/qt_common.prf index e70d3bf172..c1c668aec8 100644 --- a/mkspecs/features/qt_common.prf +++ b/mkspecs/features/qt_common.prf @@ -44,6 +44,21 @@ contains(TEMPLATE, .*lib) { QMAKE_PRL_INSTALL_REPLACE += lib_replace } +# Extra warnings for Qt non-example code, to ensure cleanliness of the sources. +# The block below may turn these warnings into errors for some Qt targets. +# -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): \ + QMAKE_CXXFLAGS_WARN_ON += -Wdate-time +} else: gcc:!intel_icc { + QMAKE_CXXFLAGS_WARN_ON += -Wvla + # GCC 5 introduced -Wdate-time + greaterThan(QT_GCC_MAJOR_VERSION, 4): QMAKE_CXXFLAGS_WARN_ON += -Wdate-time +} + warnings_are_errors:warning_clean { # If the module declares that it has does its clean-up of warnings, enable -Werror. # This setting is compiler-dependent anyway because it depends on the version of the diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index b2c2507807..2756f90b01 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -1,6 +1,7 @@ + defineReplace(qtPlatformTargetSuffix) { - ios:CONFIG(iphonesimulator, iphonesimulator|iphoneos): \ - suffix = _iphonesimulator + ios:CONFIG(simulator, simulator|device): \ + suffix = _$${simulator.sdk} else: \ suffix = diff --git a/mkspecs/features/qt_module_headers.prf b/mkspecs/features/qt_module_headers.prf index 094c854ef0..7acca41d47 100644 --- a/mkspecs/features/qt_module_headers.prf +++ b/mkspecs/features/qt_module_headers.prf @@ -155,7 +155,7 @@ headersclean:!internal_module { -DQT_NO_URL_CAST_FROM_STRING=1 \ -DQT_NO_CAST_FROM_BYTEARRAY=1 \ -DQT_NO_KEYWORDS=1 \ - -DQT_USE_FAST_CONCATENATION \ + -DQT_USE_QSTRINGBUILDER \ -DQT_USE_FAST_OPERATOR_PLUS \ -Dsignals=int \ -Dslots=int \ @@ -183,7 +183,8 @@ headersclean:!internal_module { hcleanFLAGS -= -Wshadow } } else { - hcleanFLAGS += -Wchar-subscripts + # options accepted by GCC and Clang + hcleanFLAGS += -Wchar-subscripts -Wold-style-cast !contains(QT_ARCH, arm):!contains(QT_ARCH, mips): \ hcleanFLAGS += -Wcast-align diff --git a/mkspecs/features/qt_module_pris.prf b/mkspecs/features/qt_module_pris.prf index e9e5865a84..9c45350543 100644 --- a/mkspecs/features/qt_module_pris.prf +++ b/mkspecs/features/qt_module_pris.prf @@ -10,7 +10,7 @@ # load(qt_build_paths) -force_independent|!isEmpty(MODULE_FWD_INCLUDES): \ +force_independent|split_incpath: \ CONFIG += need_fwd_pri mod_work_pfx = $$MODULE_QMAKE_OUTDIR/mkspecs/modules need_fwd_pri: \ diff --git a/mkspecs/features/qt_tool.prf b/mkspecs/features/qt_tool.prf index 839c3d6b88..bdeb59c83d 100644 --- a/mkspecs/features/qt_tool.prf +++ b/mkspecs/features/qt_tool.prf @@ -17,36 +17,45 @@ DEFINES *= QT_USE_QSTRINGBUILDER # If we are doing a prefix build, create a "module" pri which enables # qtPrepareTool() to work with the non-installed build. # Non-bootstrapped tools always need this because of the environment setup. -!build_pass:if(!host_build|!force_bootstrap|force_independent) { +!build_pass:if(!host_build|!force_bootstrap|force_independent|!isEmpty(HOST_QT_TOOLS)) { isEmpty(MODULE):MODULE = $$TARGET - !host_build|!force_bootstrap: MODULE_DEPENDS = $$replace(QT, -private$, _private) - load(qt_build_paths) - load(resolve_target) - TOOL_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules/qt_tool_$${MODULE}.pri vars = binary depends - !isEmpty(QT_TOOL_ENV) { - vars += envvars - module_var_names = - module_var_sets = - for(var, QT_TOOL_ENV) { - vars += env.$${var}.name env.$${var}.value - module_var_names += QT_TOOL.$${MODULE}.env.$${var} - module_var_sets += \ - "QT_TOOL.$${MODULE}.env.$${var}.name = $$val_escape($${var}.name)" \ - "QT_TOOL.$${MODULE}.env.$${var}.value = $$val_escape($${var}.value)" + + isEmpty(HOST_QT_TOOLS) { + load(resolve_target) + + !host_build|!force_bootstrap: MODULE_DEPENDS = $$replace(QT, -private$, _private) + + !isEmpty(QT_TOOL_ENV) { + vars += envvars + module_var_names = + module_var_sets = + for(var, QT_TOOL_ENV) { + vars += env.$${var}.name env.$${var}.value + module_var_names += QT_TOOL.$${MODULE}.env.$${var} + module_var_sets += \ + "QT_TOOL.$${MODULE}.env.$${var}.name = $$val_escape($${var}.name)" \ + "QT_TOOL.$${MODULE}.env.$${var}.value = $$val_escape($${var}.value)" + } + module_envvars = \ + "QT_TOOL.$${MODULE}.envvars = $$module_var_names" \ + $$module_var_sets + } else { + module_envvars = } - module_envvars = \ - "QT_TOOL.$${MODULE}.envvars = $$module_var_names" \ - $$module_var_sets + + bin = $$system_path($$QMAKE_RESOLVED_TARGET) } else { - module_envvars = + bin = $${HOST_QT_TOOLS}/$${TARGET} + equals(QMAKE_HOST.os, Windows): bin = $${bin}.exe + bin = $$system_path($$bin) } - bin = $$system_path($$QMAKE_RESOLVED_TARGET) + TOOL_PRI_CONT = \ "QT_TOOL.$${MODULE}.binary = $$val_escape(bin)" \ "QT_TOOL.$${MODULE}.depends =$$join(MODULE_DEPENDS, " ", " ")" \ diff --git a/mkspecs/features/simd.prf b/mkspecs/features/simd.prf index 700d79a1b5..4aafdbe5ed 100644 --- a/mkspecs/features/simd.prf +++ b/mkspecs/features/simd.prf @@ -95,6 +95,47 @@ addSimdCompiler(sse4_1) addSimdCompiler(sse4_2) addSimdCompiler(avx) addSimdCompiler(avx2) +addSimdCompiler(avx512f) +addSimdCompiler(avx512cd) +addSimdCompiler(avx512er) +addSimdCompiler(avx512pf) +addSimdCompiler(avx512dq) +addSimdCompiler(avx512bw) +addSimdCompiler(avx512vl) +addSimdCompiler(avx512ifma) +addSimdCompiler(avx512vbmi) addSimdCompiler(neon) addSimdCompiler(mips_dsp) addSimdCompiler(mips_dspr2) + +# Follow the Intel compiler's lead and define profiles of AVX512 instructions +defineTest(addAvx512Profile) { + name = $$1 + dependencies = $$2 + upname = $$upper($$name) + varname = QMAKE_CFLAGS_$$upname + + cpu_features_missing = + cflags = $$QMAKE_CFLAGS_AVX512F + for(part, dependencies) { + !CONFIG($$part): return() # Profile isn't supported by the compiler + + uppart = $$upper($$part) + cflags *= $$eval(QMAKE_CFLAGS_$${uppart}) + !contains(QT_CPU_FEATURES, $$uppart): cpu_features_missing += $$uppart + } + + CONFIG += $$name + isEmpty(cpu_features_missing): QT_CPU_FEATURES += $$name + $$varname = $$cflags + + export(QT_CPU_FEATURES) + export(CONFIG) + export($$varname) + addSimdCompiler($$name) +} +addAvx512Profile(avx512common, avx512cd) +addAvx512Profile(avx512mic, avx512cd avx512er avx512pf) +addAvx512Profile(avx512core, avx512cd avx512bw avx512dq avx512vl) +addAvx512Profile(avx512ifmavl, avx512ifma avx512vl) +addAvx512Profile(avx512vbmivl, avx512vbmi avx512vl) diff --git a/mkspecs/features/testcase.prf b/mkspecs/features/testcase.prf index 0bf0ed7b94..08ed00715d 100644 --- a/mkspecs/features/testcase.prf +++ b/mkspecs/features/testcase.prf @@ -107,11 +107,9 @@ isEmpty(BUILDS)|build_pass { tnam ~= s,[?*],wildcard, tnam ~= s,[^A-Za-z0-9],_, tdi = testdata_$$tnam - tdif = $${tdi}.files - tdip = $${tdi}.path # TESTDATA consists of the files to install (source)... - $$tdif = $$file + $${tdi}.files = $$file # ... and the destination preserves the relative path. # Strip any leading ../ from the testdata, so that installation does not escape @@ -127,7 +125,7 @@ isEmpty(BUILDS)|build_pass { # and testdata in the build and install tree, but should cover most cases. # file = $$replace(file, ^(\\.\\./)+, ) - $$tdip = $${target.path}/$$dirname(file) + $${tdi}.path = $${target.path}/$$dirname(file) INSTALLS += $$tdi } @@ -141,15 +139,12 @@ isEmpty(BUILDS)|build_pass { tnam ~= s,[?*],wildcard, tnam ~= s,[^A-Za-z0-9],_, tdi = testdata_$$tnam - tdif = $${tdi}.files - tdip = $${tdi}.path - tdic = $${tdi}.CONFIG - $$tdif = $$file - $$tdic = no_check_exist + $${tdi}.files = $$file + $${tdi}.CONFIG = no_check_exist file = $$replace(file, ^(\\.\\./)+, ) - $$tdip = $${target.path}/$$dirname(file) + $${tdi}.path = $${target.path}/$$dirname(file) INSTALLS += $$tdi } |