From 4c2906fb72e8fad9b8523cae7972a1003780b7c3 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Mon, 22 Aug 2022 19:31:46 +1000 Subject: [PATCH] dep/soundtouch: Export main class on Android --- dep/soundtouch/CMakeLists.txt | 9 ++++++++- dep/soundtouch/include/SoundTouch.h | 7 ++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/dep/soundtouch/CMakeLists.txt b/dep/soundtouch/CMakeLists.txt index 7d3984061..e38d58450 100644 --- a/dep/soundtouch/CMakeLists.txt +++ b/dep/soundtouch/CMakeLists.txt @@ -5,7 +5,14 @@ else() set(COMPILE_OPTIONS -Ofast) endif() -add_library(soundtouch +if(NOT ANDROID) + add_library(soundtouch STATIC) +else() + add_library(soundtouch SHARED) + set(COMPILE_DEFINITIONS "${COMPILE_DEFINITIONS}" "ST_EXPORT") +endif() + +target_sources(soundtouch PRIVATE source/SoundTouch/AAFilter.cpp source/SoundTouch/BPMDetect.cpp source/SoundTouch/cpu_detect_x86.cpp diff --git a/dep/soundtouch/include/SoundTouch.h b/dep/soundtouch/include/SoundTouch.h index 850b9c759..54a54e03e 100644 --- a/dep/soundtouch/include/SoundTouch.h +++ b/dep/soundtouch/include/SoundTouch.h @@ -164,8 +164,13 @@ namespace soundtouch /// tempo/pitch/rate/samplerate settings. #define SETTING_INITIAL_LATENCY 8 +#ifdef ST_EXPORT +#define ST_VISIBILITY __attribute__ ((visibility ("default"))) +#else +#define ST_VISIBILITY +#endif -class SoundTouch : public FIFOProcessor +class ST_VISIBILITY SoundTouch : public FIFOProcessor { private: /// Rate transposer class instance