Duckstation/dep/soundtouch/CMakeLists.txt

42 lines
1.4 KiB
CMake
Raw Normal View History

2022-07-26 15:39:58 +00:00
if(MSVC)
set(COMPILE_DEFINITIONS /O2 /fp:fast)
set(COMPILE_OPTIONS )
else()
set(COMPILE_OPTIONS -Ofast)
endif()
if(NOT ANDROID)
add_library(soundtouch STATIC)
else()
add_library(soundtouch SHARED)
set(COMPILE_DEFINITIONS "${COMPILE_DEFINITIONS}" "ST_EXPORT")
endif()
target_sources(soundtouch PRIVATE
2022-07-26 15:39:58 +00:00
source/SoundTouch/AAFilter.cpp
source/SoundTouch/BPMDetect.cpp
source/SoundTouch/cpu_detect_x86.cpp
source/SoundTouch/FIFOSampleBuffer.cpp
source/SoundTouch/FIRFilter.cpp
source/SoundTouch/InterpolateCubic.cpp
source/SoundTouch/InterpolateLinear.cpp
source/SoundTouch/InterpolateShannon.cpp
source/SoundTouch/mmx_optimized.cpp
source/SoundTouch/PeakFinder.cpp
source/SoundTouch/RateTransposer.cpp
source/SoundTouch/SoundTouch.cpp
source/SoundTouch/sse_optimized.cpp
source/SoundTouch/TDStretch.cpp
)
target_include_directories(soundtouch PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
target_compile_definitions(soundtouch PRIVATE ${COMPILE_DEFINITIONS})
target_compile_options(soundtouch PRIVATE ${COMPILE_OPTIONS})
2023-01-30 13:21:52 +00:00
target_compile_definitions(soundtouch PUBLIC SOUNDTOUCH_FLOAT_SAMPLES ST_NO_EXCEPTION_HANDLING=1)
2022-07-26 15:39:58 +00:00
if("${CPU_ARCH}" STREQUAL "aarch32" OR "${CPU_ARCH}" STREQUAL "aarch64")
2022-07-26 15:39:58 +00:00
target_compile_definitions(soundtouch PRIVATE SOUNDTOUCH_USE_NEON)
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(armv7.*)$")
target_compile_options(soundtouch PRIVATE -mfpu=neon)
endif()
endif()