35 lines
1.2 KiB
CMake
35 lines
1.2 KiB
CMake
|
if(MSVC)
|
||
|
set(COMPILE_DEFINITIONS /O2 /fp:fast)
|
||
|
set(COMPILE_OPTIONS )
|
||
|
else()
|
||
|
set(COMPILE_OPTIONS -Ofast)
|
||
|
endif()
|
||
|
|
||
|
add_library(soundtouch
|
||
|
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})
|
||
|
target_compile_definitions(soundtouch PRIVATE SOUNDTOUCH_FLOAT_SAMPLES)
|
||
|
|
||
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(armv7.*|armv8.*|aarch64.*)$")
|
||
|
target_compile_definitions(soundtouch PRIVATE SOUNDTOUCH_USE_NEON)
|
||
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(armv7.*)$")
|
||
|
target_compile_options(soundtouch PRIVATE -mfpu=neon)
|
||
|
endif()
|
||
|
endif()
|