dolphin/Source/Core/AudioCommon/CMakeLists.txt

73 lines
2.3 KiB
CMake
Raw Normal View History

2017-02-04 23:18:59 +00:00
set(SRCS
AudioCommon.cpp
AudioStretcher.cpp
2017-03-22 23:09:59 +00:00
CubebStream.cpp
CubebUtils.cpp
2017-02-04 23:18:59 +00:00
DPL2Decoder.cpp
Mixer.cpp
WaveFile.cpp
NullSoundStream.cpp
)
add_dolphin_library(audiocommon "${SRCS}" "")
find_package(OpenSLES)
if(OPENSLES_FOUND)
2017-02-04 23:18:59 +00:00
message(STATUS "OpenSLES found, enabling OpenSLES sound backend")
target_sources(audiocommon PRIVATE OpenSLESStream.cpp)
target_link_libraries(audiocommon PRIVATE OpenSLES::OpenSLES)
2017-01-25 05:25:52 +00:00
endif()
2013-02-26 19:49:00 +00: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 05:25:52 +00:00
endif()
2011-12-05 04:49:08 +00: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 05:25:52 +00:00
endif()
2011-12-05 04:49:08 +00:00
if(WIN32)
target_sources(audiocommon PRIVATE XAudio2Stream.cpp)
2017-02-04 23:18:59 +00: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
)
target_link_libraries(audiocommon PRIVATE audiocommon_xaudio27)
2017-06-26 06:52:51 +00:00
set(ENV{OPENALDIR} ${PROJECT_SOURCE_DIR}/Externals/OpenAL)
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()
message(FATAL_ERROR "OpenAL NOT found in Externals")
endif()
endif()
2017-03-22 23:09:59 +00:00
target_link_libraries(audiocommon PRIVATE cubeb SoundTouch)