2020-04-01 18:42:41 +02:00
|
|
|
macro(sfizz_add_simd_sources SOURCES_VAR PREFIX)
|
|
|
|
|
# It needs a macro, otherwise the source properties cannot take effect.
|
2019-11-25 16:10:30 +01:00
|
|
|
|
2020-12-14 07:49:02 +01:00
|
|
|
list(APPEND ${SOURCES_VAR}
|
2020-06-01 09:12:42 +02:00
|
|
|
${PREFIX}/sfizz/SIMDHelpers.cpp
|
2020-09-18 22:04:13 +01:00
|
|
|
${PREFIX}/sfizz/simd/HelpersNEON.cpp
|
2020-06-01 09:12:42 +02:00
|
|
|
${PREFIX}/sfizz/simd/HelpersSSE.cpp
|
|
|
|
|
${PREFIX}/sfizz/simd/HelpersAVX.cpp)
|
2020-04-01 18:42:41 +02:00
|
|
|
|
|
|
|
|
# For CPU-dispatched X86 sources
|
|
|
|
|
# Always build them for all X86 targets.
|
2023-05-29 13:17:52 -04:00
|
|
|
if(PROJECT_SYSTEM_PROCESSOR MATCHES "(x86_64|amd64|AMD64|x64|X64|i.86|x86|X86)")
|
2020-04-01 18:42:41 +02:00
|
|
|
# on GCC, it requires to set ISA support flags on individual files
|
|
|
|
|
# to be able to use the intrinsics
|
2020-12-14 07:49:02 +01:00
|
|
|
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
|
2020-04-01 18:42:41 +02:00
|
|
|
set_source_files_properties(
|
|
|
|
|
${PREFIX}/sfizz/effects/impl/ResonantStringAVX.cpp
|
|
|
|
|
${PREFIX}/sfizz/effects/impl/ResonantArrayAVX.cpp
|
2020-06-01 09:12:42 +02:00
|
|
|
${PREFIX}/sfizz/simd/HelpersAVX.cpp
|
2020-04-01 18:42:41 +02:00
|
|
|
PROPERTIES COMPILE_FLAGS "-mavx")
|
|
|
|
|
endif()
|
|
|
|
|
endif()
|
|
|
|
|
endmacro()
|