2018-03-22 19:58:56 -06:00
|
|
|
add_library(audiocommon
|
2017-02-04 16:18:59 -07:00
|
|
|
AudioCommon.cpp
|
2019-05-29 02:23:13 -06:00
|
|
|
AudioCommon.h
|
2017-04-23 20:08:33 -06:00
|
|
|
AudioStretcher.cpp
|
2019-05-29 02:23:13 -06:00
|
|
|
AudioStretcher.h
|
2017-03-22 17:09:59 -06:00
|
|
|
CubebStream.cpp
|
2019-05-29 02:23:13 -06:00
|
|
|
CubebStream.h
|
2017-04-24 00:55:37 -06:00
|
|
|
CubebUtils.cpp
|
2019-05-29 02:23:13 -06:00
|
|
|
CubebUtils.h
|
2019-03-18 05:22:27 -06:00
|
|
|
Enums.h
|
2017-02-04 16:18:59 -07:00
|
|
|
Mixer.cpp
|
2019-05-29 02:23:13 -06:00
|
|
|
Mixer.h
|
2017-08-09 13:57:26 -06:00
|
|
|
SurroundDecoder.cpp
|
2019-05-29 02:23:13 -06:00
|
|
|
SurroundDecoder.h
|
2017-02-04 16:18:59 -07:00
|
|
|
NullSoundStream.cpp
|
2019-05-29 02:23:13 -06:00
|
|
|
NullSoundStream.h
|
2018-03-22 19:58:56 -06:00
|
|
|
WaveFile.cpp
|
2019-05-29 02:23:13 -06:00
|
|
|
WaveFile.h
|
2017-02-04 16:18:59 -07:00
|
|
|
)
|
2010-11-01 09:47:02 -06:00
|
|
|
|
2022-08-07 17:17:41 -06:00
|
|
|
if(ANDROID)
|
|
|
|
find_package(OpenSLES)
|
|
|
|
if(OPENSLES_FOUND)
|
|
|
|
message(STATUS "OpenSLES found, enabling OpenSLES sound backend")
|
|
|
|
target_sources(audiocommon PRIVATE
|
|
|
|
OpenSLESStream.cpp
|
|
|
|
OpenSLESStream.h
|
|
|
|
)
|
|
|
|
target_link_libraries(audiocommon PRIVATE OpenSLES::OpenSLES)
|
|
|
|
target_compile_definitions(audiocommon PRIVATE HAVE_OPENSL_ES=1)
|
|
|
|
endif()
|
2017-01-24 22:25:52 -07:00
|
|
|
endif()
|
2013-02-26 12:49:00 -07:00
|
|
|
|
2017-02-04 18:44:03 -07:00
|
|
|
if(ENABLE_ALSA)
|
|
|
|
find_package(ALSA)
|
|
|
|
if(ALSA_FOUND)
|
|
|
|
message(STATUS "ALSA found, enabling ALSA sound backend")
|
2019-05-29 02:23:13 -06:00
|
|
|
target_sources(audiocommon PRIVATE
|
|
|
|
AlsaSoundStream.cpp
|
|
|
|
AlsaSoundStream.h
|
|
|
|
)
|
2017-02-04 18:44:03 -07:00
|
|
|
target_link_libraries(audiocommon PRIVATE ALSA::ALSA)
|
|
|
|
target_compile_definitions(audiocommon PRIVATE HAVE_ALSA=1)
|
|
|
|
else()
|
|
|
|
message(STATUS "ALSA NOT found, disabling ALSA sound backend")
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
message(STATUS "ALSA explicitly disabled, disabling ALSA sound backend")
|
2017-01-24 22:25:52 -07:00
|
|
|
endif()
|
2011-12-04 21:49:08 -07:00
|
|
|
|
2017-02-07 15:28:01 -07:00
|
|
|
if(ENABLE_PULSEAUDIO)
|
|
|
|
# PulseAudio ships with a PulseAudioConfig.cmake with no imported target
|
|
|
|
# So we use our own FindPulseAudio instead with "MODULE"
|
|
|
|
find_package(PulseAudio MODULE QUIET)
|
2020-09-08 21:24:34 -06:00
|
|
|
if(PulseAudio_FOUND)
|
2017-02-07 15:28:01 -07:00
|
|
|
message(STATUS "PulseAudio found, enabling PulseAudio sound backend")
|
2019-05-29 02:23:13 -06:00
|
|
|
target_sources(audiocommon PRIVATE
|
|
|
|
PulseAudioStream.cpp
|
|
|
|
PulseAudioStream.h
|
|
|
|
)
|
2017-02-07 15:28:01 -07:00
|
|
|
target_link_libraries(audiocommon PRIVATE PulseAudio::PulseAudio)
|
|
|
|
target_compile_definitions(audiocommon PRIVATE HAVE_PULSEAUDIO=1)
|
|
|
|
else()
|
|
|
|
message(STATUS "PulseAudio NOT found, disabling PulseAudio sound backend")
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
message(STATUS "PulseAudio explicitly disabled, disabling PulseAudio sound backend")
|
2017-01-24 22:25:52 -07:00
|
|
|
endif()
|
2011-12-04 21:49:08 -07:00
|
|
|
|
|
|
|
if(WIN32)
|
2019-05-29 02:23:13 -06:00
|
|
|
target_sources(audiocommon PRIVATE
|
|
|
|
# Dolphin loads openal32.dll at runtime
|
|
|
|
OpenALStream.cpp
|
|
|
|
OpenALStream.h
|
|
|
|
|
|
|
|
WASAPIStream.cpp
|
|
|
|
WASAPIStream.h
|
|
|
|
)
|
2010-11-01 09:47:02 -06:00
|
|
|
endif()
|
|
|
|
|
2020-10-14 12:50:38 -06:00
|
|
|
target_link_libraries(audiocommon
|
|
|
|
PUBLIC
|
|
|
|
common
|
|
|
|
|
|
|
|
PRIVATE
|
|
|
|
cubeb
|
|
|
|
SoundTouch
|
|
|
|
FreeSurround)
|
2022-05-21 17:19:44 -06:00
|
|
|
|
|
|
|
if(MSVC)
|
|
|
|
# Add precompiled header
|
|
|
|
target_link_libraries(audiocommon PRIVATE use_pch)
|
|
|
|
endif()
|