sfizz/cmake/SfizzSIMDSourceFiles.cmake

23 lines
944 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-04-01 18:42:41 +02:00
list (APPEND ${SOURCES_VAR}
${PREFIX}/sfizz/SIMDHelpers.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.
if (SFIZZ_SYSTEM_PROCESSOR MATCHES "^(x86_64|amd64|AMD64|x64|X64|i.86|x86|X86)$")
# on GCC, it requires to set ISA support flags on individual files
# to be able to use the intrinsics
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
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()