blob: 04ad9672344ce903dcf2efb9c8676ead1a63f51c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
add_library(audiocommon
AudioCommon.cpp
AudioCommon.h
CubebStream.h
Enums.h
Mixer.cpp
Mixer.h
SurroundDecoder.cpp
SurroundDecoder.h
NullSoundStream.cpp
NullSoundStream.h
WaveFile.cpp
WaveFile.h
)
if(ENABLE_CUBEB)
message(STATUS "Cubeb found, enabling Cubeb sound backend")
target_sources(audiocommon PRIVATE
CubebStream.cpp
CubebUtils.cpp
CubebUtils.h
)
target_link_libraries(audiocommon PRIVATE cubeb)
endif()
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()
endif()
if(ENABLE_ALSA)
find_package(ALSA)
if(ALSA_FOUND)
message(STATUS "ALSA found, enabling ALSA sound backend")
target_sources(audiocommon PRIVATE
AlsaSoundStream.cpp
AlsaSoundStream.h
)
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")
endif()
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
PulseAudioStream.h
)
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")
endif()
if(WIN32)
target_sources(audiocommon PRIVATE
# Dolphin loads openal32.dll at runtime
OpenALStream.cpp
OpenALStream.h
WASAPIStream.cpp
WASAPIStream.h
)
endif()
target_link_libraries(audiocommon
PUBLIC
common
PRIVATE
FreeSurround)
if(ENABLE_CUBEB)
target_link_libraries(audiocommon PRIVATE cubeb::cubeb)
endif()
if(MSVC)
# Add precompiled header
target_link_libraries(audiocommon PRIVATE use_pch)
endif()
|