sfizz/cmake/SfizzSIMDSourceFiles.cmake

24 lines
988 B
CMake
Raw Normal View History

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}
${PREFIX}/sfizz/SIMDHelpers.cpp
${PREFIX}/sfizz/simd/HelpersNEON.cpp
${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-03-31 18:47:37 +02: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
${PREFIX}/sfizz/simd/HelpersAVX.cpp
2020-04-01 18:42:41 +02:00
PROPERTIES COMPILE_FLAGS "-mavx")
endif()
endif()
endmacro()