2017-02-04 16:18:59 -07:00
|
|
|
set(SRCS
|
|
|
|
AudioCommon.cpp
|
|
|
|
DPL2Decoder.cpp
|
|
|
|
Mixer.cpp
|
|
|
|
WaveFile.cpp
|
|
|
|
NullSoundStream.cpp
|
|
|
|
)
|
2010-11-01 09:47:02 -06:00
|
|
|
|
2017-02-04 16:33:53 -07:00
|
|
|
add_dolphin_library(audiocommon "${SRCS}" "")
|
2010-11-01 09:47:02 -06:00
|
|
|
|
2017-02-03 16:55:29 -07:00
|
|
|
find_package(OpenSLES)
|
2016-02-05 09:54:59 -07:00
|
|
|
if(OPENSLES_FOUND)
|
2017-02-04 16:18:59 -07:00
|
|
|
message(STATUS "OpenSLES found, enabling OpenSLES sound backend")
|
2017-02-04 16:33:53 -07:00
|
|
|
target_sources(audiocommon PRIVATE OpenSLESStream.cpp)
|
|
|
|
target_link_libraries(audiocommon PRIVATE OpenSLES::OpenSLES)
|
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")
|
|
|
|
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-24 22:25:52 -07:00
|
|
|
endif()
|
2011-12-04 21:49:08 -07:00
|
|
|
|
2017-02-04 21:08:30 -07:00
|
|
|
if(ENABLE_AO)
|
|
|
|
find_package(AO)
|
|
|
|
if(AO_FOUND)
|
|
|
|
message(STATUS "ao found, enabling ao sound backend")
|
|
|
|
target_sources(audiocommon PRIVATE AOSoundStream.cpp)
|
|
|
|
target_link_libraries(audiocommon PRIVATE AO::AO)
|
|
|
|
target_compile_definitions(audiocommon PRIVATE HAVE_AO=1)
|
|
|
|
else()
|
|
|
|
message(STATUS "ao NOT found, disabling ao sound backend")
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
message(STATUS "ao explicitly disabled, disabling ao sound backend")
|
2017-01-24 22:25:52 -07:00
|
|
|
endif()
|
2011-12-04 21:49:08 -07:00
|
|
|
|
|
|
|
if(OPENAL_FOUND)
|
2017-02-04 16:33:53 -07:00
|
|
|
target_sources(audiocommon PRIVATE OpenALStream.cpp aldlist.cpp)
|
|
|
|
target_link_libraries(audiocommon PRIVATE ${OPENAL_LIBRARY} SoundTouch)
|
2017-01-24 22:25:52 -07:00
|
|
|
endif()
|
2011-12-04 21:49:08 -07:00
|
|
|
|
|
|
|
if(PULSEAUDIO_FOUND)
|
2017-02-04 16:33:53 -07:00
|
|
|
target_sources(audiocommon PRIVATE PulseAudioStream.cpp)
|
|
|
|
target_link_libraries(audiocommon PRIVATE ${PULSEAUDIO_LIBRARIES})
|
2017-01-24 22:25:52 -07:00
|
|
|
endif()
|
2011-12-04 21:49:08 -07:00
|
|
|
|
|
|
|
if(WIN32)
|
2017-02-04 16:33:53 -07:00
|
|
|
target_sources(audiocommon PRIVATE XAudio2Stream.cpp)
|
2017-01-20 14:56:15 -07:00
|
|
|
|
2017-02-04 16:18:59 -07:00
|
|
|
add_dolphin_library(audiocommon_xaudio27 "XAudio2_7Stream.cpp" "${LIBS}")
|
|
|
|
target_include_directories(audiocommon_xaudio27 PRIVATE
|
|
|
|
${PROJECT_SOURCE_DIR}/Externals
|
|
|
|
${PROJECT_SOURCE_DIR}/Externals/XAudio2_7
|
|
|
|
)
|
2017-02-04 16:33:53 -07:00
|
|
|
target_link_libraries(audiocommon PRIVATE audiocommon_xaudio27)
|
2017-01-20 14:56:15 -07:00
|
|
|
|
2015-01-03 05:17:57 -07:00
|
|
|
elseif(APPLE)
|
2017-02-04 16:33:53 -07:00
|
|
|
target_sources(audiocommon PRIVATE CoreAudioSoundStream.cpp)
|
2010-11-01 09:47:02 -06:00
|
|
|
endif()
|
|
|
|
|
2017-01-20 14:56:15 -07:00
|
|
|
|