2018-03-22 21:58:56 -04:00
|
|
|
add_library(audiocommon
|
2017-02-05 00:18:59 +01:00
|
|
|
AudioCommon.cpp
|
2017-04-23 19:08:33 -07:00
|
|
|
AudioStretcher.cpp
|
2017-03-22 16:09:59 -07:00
|
|
|
CubebStream.cpp
|
2017-04-23 23:55:37 -07:00
|
|
|
CubebUtils.cpp
|
2017-02-05 00:18:59 +01:00
|
|
|
Mixer.cpp
|
2017-08-09 16:57:26 -03:00
|
|
|
SurroundDecoder.cpp
|
2017-02-05 00:18:59 +01:00
|
|
|
NullSoundStream.cpp
|
2018-03-22 21:58:56 -04:00
|
|
|
WaveFile.cpp
|
2017-02-05 00:18:59 +01:00
|
|
|
)
|
2010-11-01 15:47:02 +00:00
|
|
|
|
2017-02-04 00:55:29 +01:00
|
|
|
find_package(OpenSLES)
|
2016-02-05 10:54:59 -06:00
|
|
|
if(OPENSLES_FOUND)
|
2017-02-05 00:18:59 +01:00
|
|
|
message(STATUS "OpenSLES found, enabling OpenSLES sound backend")
|
2017-02-05 00:33:53 +01:00
|
|
|
target_sources(audiocommon PRIVATE OpenSLESStream.cpp)
|
|
|
|
target_link_libraries(audiocommon PRIVATE OpenSLES::OpenSLES)
|
2017-01-25 06:25:52 +01:00
|
|
|
endif()
|
2013-02-26 13:49:00 -06:00
|
|
|
|
2017-02-05 02:44:03 +01:00
|
|
|
if(ENABLE_ALSA)
|
|
|
|
find_package(ALSA)
|
|
|
|
if(ALSA_FOUND)
|
|
|
|
message(STATUS "ALSA found, enabling ALSA sound backend")
|
|
|
|
target_sources(audiocommon PRIVATE AlsaSoundStream.cpp)
|
|
|
|
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-25 06:25:52 +01:00
|
|
|
endif()
|
2011-12-05 05:49:08 +01:00
|
|
|
|
2017-02-07 23:28:01 +01: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)
|
|
|
|
if(PULSEAUDIO_FOUND)
|
|
|
|
message(STATUS "PulseAudio found, enabling PulseAudio sound backend")
|
|
|
|
target_sources(audiocommon PRIVATE PulseAudioStream.cpp)
|
|
|
|
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-25 06:25:52 +01:00
|
|
|
endif()
|
2011-12-05 05:49:08 +01:00
|
|
|
|
|
|
|
if(WIN32)
|
2018-02-10 21:03:27 +01:00
|
|
|
target_sources(audiocommon PRIVATE WASAPIStream.cpp)
|
2017-02-05 00:33:53 +01:00
|
|
|
target_sources(audiocommon PRIVATE XAudio2Stream.cpp)
|
2017-01-20 22:56:15 +01:00
|
|
|
|
2018-03-22 21:58:56 -04:00
|
|
|
add_library(audiocommon_xaudio27 "XAudio2_7Stream.cpp")
|
2017-02-05 00:18:59 +01:00
|
|
|
target_include_directories(audiocommon_xaudio27 PRIVATE
|
|
|
|
${PROJECT_SOURCE_DIR}/Externals
|
|
|
|
${PROJECT_SOURCE_DIR}/Externals/XAudio2_7
|
|
|
|
)
|
2017-02-05 00:33:53 +01:00
|
|
|
target_link_libraries(audiocommon PRIVATE audiocommon_xaudio27)
|
2017-01-20 22:56:15 +01:00
|
|
|
|
2017-06-25 23:52:51 -07:00
|
|
|
set(ENV{OPENALDIR} ${PROJECT_SOURCE_DIR}/Externals/OpenAL)
|
2018-03-09 12:29:23 -05:00
|
|
|
# Dolphin loads openal32.dll at runtime
|
2017-06-25 23:52:51 -07:00
|
|
|
find_package(OpenAL)
|
|
|
|
if(OPENAL_FOUND)
|
|
|
|
message(STATUS "OpenAL found, enabling OpenAL sound backend")
|
|
|
|
target_sources(audiocommon PRIVATE OpenALStream.cpp)
|
|
|
|
target_link_libraries(audiocommon PRIVATE OpenAL::OpenAL)
|
|
|
|
else()
|
2018-03-09 12:29:23 -05:00
|
|
|
message(STATUS "OpenAL NOT found in Externals")
|
2017-06-25 23:52:51 -07:00
|
|
|
endif()
|
2010-11-01 15:47:02 +00:00
|
|
|
endif()
|
|
|
|
|
2017-08-09 16:57:26 -03:00
|
|
|
target_link_libraries(audiocommon PRIVATE cubeb SoundTouch FreeSurround)
|