You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
101 lines
3.9 KiB
101 lines
3.9 KiB
5 months ago
|
#
|
||
|
# W A R N I N G
|
||
|
# -------------
|
||
|
#
|
||
|
# This file is not part of the Qt API. It exists purely as an
|
||
|
# implementation detail. It may change from version to version
|
||
|
# without notice, or even be removed.
|
||
|
#
|
||
|
# We mean it.
|
||
|
#
|
||
|
|
||
|
# Get the SIMD flags
|
||
|
load(qt_build_config)
|
||
|
|
||
|
# Set QT_CPU_FEATURES for convenience
|
||
|
QT_CPU_FEATURES = $$eval(QT_CPU_FEATURES.$$QT_ARCH)
|
||
|
|
||
|
#
|
||
|
# Set up compilers for SIMD (SSE/AVX, NEON etc)
|
||
|
#
|
||
|
defineTest(addSimdCompiler) {
|
||
|
name = $$1
|
||
|
upname = $$upper($$name)
|
||
|
headers_var = $${upname}_HEADERS
|
||
|
sources_var = $${upname}_SOURCES
|
||
|
asm_var = $${upname}_ASM
|
||
|
|
||
|
CONFIG($$1) {
|
||
|
cflags = $$eval(QMAKE_CFLAGS_$${upname})
|
||
|
ltcg: cflags += $$QMAKE_CFLAGS_DISABLE_LTCG
|
||
|
contains(QT_CPU_FEATURES, $$name) {
|
||
|
# Default compiler settings include this feature, so just add to SOURCES
|
||
|
SOURCES += $$eval($$sources_var)
|
||
|
export(SOURCES)
|
||
|
} else {
|
||
|
# We need special compiler flags
|
||
|
$${name}_compiler.commands = $$QMAKE_CXX -c $(CXXFLAGS) $$cflags $(INCPATH) ${QMAKE_FILE_IN}
|
||
|
msvc: $${name}_compiler.commands += -Fo${QMAKE_FILE_OUT}
|
||
|
else: $${name}_compiler.commands += -o ${QMAKE_FILE_OUT}
|
||
|
|
||
|
$${name}_compiler.dependency_type = TYPE_C
|
||
|
$${name}_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
|
||
|
$${name}_compiler.input = $$sources_var
|
||
|
$${name}_compiler.variable_out = OBJECTS
|
||
|
$${name}_compiler.name = compiling[$${name}] ${QMAKE_FILE_IN}
|
||
|
silent: $${name}_compiler.commands = @echo compiling[$${name}] ${QMAKE_FILE_IN} && $$eval($${name}_compiler.commands)
|
||
|
QMAKE_EXTRA_COMPILERS += $${name}_compiler
|
||
|
|
||
|
export($${name}_compiler.commands)
|
||
|
export($${name}_compiler.dependency_type)
|
||
|
export($${name}_compiler.output)
|
||
|
export($${name}_compiler.input)
|
||
|
export($${name}_compiler.variable_out)
|
||
|
export($${name}_compiler.name)
|
||
|
}
|
||
|
|
||
|
# We always need an assembler (need to run the C compiler and without precompiled headers)
|
||
|
msvc {
|
||
|
# Don't know how to run MSVC's assembler...
|
||
|
!isEmpty($$asm_var): error("Sorry, not implemented: assembling $$upname for MSVC.")
|
||
|
} else: false {
|
||
|
# This is just for the IDE
|
||
|
SOURCES += $$eval($$asm_var)
|
||
|
export(SOURCES)
|
||
|
} else {
|
||
|
$${name}_assembler.commands = $$QMAKE_CC -c $(CFLAGS)
|
||
|
!contains(QT_CPU_FEATURES, $${name}): $${name}_assembler.commands += $$cflags
|
||
|
clang:no_clang_integrated_as: $${name}_assembler.commands += -fno-integrated-as
|
||
|
$${name}_assembler.commands += $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
|
||
|
$${name}_assembler.dependency_type = TYPE_C
|
||
|
$${name}_assembler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
|
||
|
$${name}_assembler.input = $$asm_var
|
||
|
$${name}_assembler.variable_out = OBJECTS
|
||
|
$${name}_assembler.name = assembling[$${name}] ${QMAKE_FILE_IN}
|
||
|
silent: $${name}_assembler.commands = @echo assembling[$${name}] ${QMAKE_FILE_IN} && $$eval($${name}_assembler.commands)
|
||
|
QMAKE_EXTRA_COMPILERS += $${name}_assembler
|
||
|
|
||
|
export($${name}_assembler.commands)
|
||
|
export($${name}_assembler.dependency_type)
|
||
|
export($${name}_assembler.output)
|
||
|
export($${name}_assembler.input)
|
||
|
export($${name}_assembler.variable_out)
|
||
|
export($${name}_assembler.name)
|
||
|
}
|
||
|
|
||
|
HEADERS += $$eval($$headers_var)
|
||
|
export(HEADERS)
|
||
|
export(QMAKE_EXTRA_COMPILERS)
|
||
|
}
|
||
|
}
|
||
|
addSimdCompiler(sse2)
|
||
|
addSimdCompiler(sse3)
|
||
|
addSimdCompiler(ssse3)
|
||
|
addSimdCompiler(sse4_1)
|
||
|
addSimdCompiler(sse4_2)
|
||
|
addSimdCompiler(avx)
|
||
|
addSimdCompiler(avx2)
|
||
|
addSimdCompiler(neon)
|
||
|
addSimdCompiler(mips_dsp)
|
||
|
addSimdCompiler(mips_dspr2)
|