[XAudio2] share Xbox audio device enumeration with desktop and Windows 8.1 compatibility
[xbmc.git] / xbmc / cores / AudioEngine / CMakeLists.txt
blobd3a5acc973a64e8967ab8d86ea7e3f1188a58e40
1 set(SOURCES AEResampleFactory.cpp
2             AESinkFactory.cpp
3             Encoders/AEEncoderFFmpeg.cpp
4             Engines/ActiveAE/ActiveAE.cpp
5             Engines/ActiveAE/ActiveAEBuffer.cpp
6             Engines/ActiveAE/ActiveAEFilter.cpp
7             Engines/ActiveAE/ActiveAESink.cpp
8             Engines/ActiveAE/ActiveAEStream.cpp
9             Engines/ActiveAE/ActiveAESound.cpp
10             Engines/ActiveAE/ActiveAESettings.cpp
11             Utils/AEBitstreamPacker.cpp
12             Utils/AEChannelInfo.cpp
13             Utils/AEDeviceInfo.cpp
14             Utils/AELimiter.cpp
15             Utils/AEPackIEC61937.cpp
16             Utils/AEStreamInfo.cpp
17             Utils/AEUtil.cpp
18             Utils/PackerMAT.cpp)
20 set(HEADERS AEResampleFactory.h
21             AESinkFactory.h
22             Encoders/AEEncoderFFmpeg.h
23             Engines/ActiveAE/ActiveAE.h
24             Engines/ActiveAE/ActiveAEBuffer.h
25             Engines/ActiveAE/ActiveAEFilter.h
26             Engines/ActiveAE/ActiveAESink.h
27             Engines/ActiveAE/ActiveAESound.h
28             Engines/ActiveAE/ActiveAEStream.h
29             Engines/ActiveAE/ActiveAESettings.h
30             Interfaces/AE.h
31             Interfaces/AEEncoder.h
32             Interfaces/AEResample.h
33             Interfaces/AESink.h
34             Interfaces/AESound.h
35             Interfaces/AEStream.h
36             Interfaces/IAudioCallback.h
37             Interfaces/ThreadedAE.h
38             Utils/AEAudioFormat.h
39             Utils/AEBitstreamPacker.h
40             Utils/AEChannelData.h
41             Utils/AEChannelInfo.h
42             Utils/AEDeviceInfo.h
43             Utils/AELimiter.h
44             Utils/AEPackIEC61937.h
45             Utils/AERingBuffer.h
46             Utils/AEStreamData.h
47             Utils/AEStreamInfo.h
48             Utils/AEUtil.h
49             Utils/PackerMAT.h)
51 if(TARGET ${APP_NAME_LC}::Alsa)
52   list(APPEND SOURCES Sinks/AESinkALSA.cpp
53                       Utils/AEELDParser.cpp)
54   list(APPEND HEADERS Sinks/AESinkALSA.h
55                       Utils/AEELDParser.h)
57   if(NOT "x11" IN_LIST CORE_PLATFORM_NAME_LC)
58     list(APPEND SOURCES Sinks/alsa/ALSAHControlMonitor.cpp)
59     list(APPEND HEADERS Sinks/alsa/ALSAHControlMonitor.h)
60   endif()
62   if(TARGET ${APP_NAME_LC}::UDEV)
63     list(APPEND SOURCES Sinks/alsa/ALSADeviceMonitor.cpp)
64     list(APPEND HEADERS Sinks/alsa/ALSADeviceMonitor.h)
65   endif()
66 endif()
68 if(TARGET ${APP_NAME_LC}::PulseAudio)
69   list(APPEND SOURCES Sinks/AESinkPULSE.cpp)
70   list(APPEND HEADERS Sinks/AESinkPULSE.h)
71 endif()
73 if(TARGET ${APP_NAME_LC}::Pipewire)
74   list(APPEND SOURCES Sinks/pipewire/AESinkPipewire.cpp
75                       Sinks/pipewire/Pipewire.cpp
76                       Sinks/pipewire/PipewireContext.cpp
77                       Sinks/pipewire/PipewireCore.cpp
78                       Sinks/pipewire/PipewireGlobal.cpp
79                       Sinks/pipewire/PipewireNode.cpp
80                       Sinks/pipewire/PipewireProxy.cpp
81                       Sinks/pipewire/PipewireRegistry.cpp
82                       Sinks/pipewire/PipewireStream.cpp
83                       Sinks/pipewire/PipewireThreadLoop.cpp)
84   list(APPEND HEADERS Sinks/pipewire/AESinkPipewire.h
85                       Sinks/pipewire/Pipewire.h
86                       Sinks/pipewire/PipewireContext.h
87                       Sinks/pipewire/PipewireCore.h
88                       Sinks/pipewire/PipewireGlobal.h
89                       Sinks/pipewire/PipewireNode.h
90                       Sinks/pipewire/PipewireProxy.h
91                       Sinks/pipewire/PipewireRegistry.h
92                       Sinks/pipewire/PipewireStream.h
93                       Sinks/pipewire/PipewireThreadLoop.h)
94 endif()
96 if(TARGET ${APP_NAME_LC}::Sndio)
97   list(APPEND SOURCES Sinks/AESinkSNDIO.cpp)
98   list(APPEND HEADERS Sinks/AESinkSNDIO.h)
99 endif()
101 if(TARGET ${APP_NAME_LC}::FFMPEG)
102   list(APPEND SOURCES Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp)
103   list(APPEND HEADERS Engines/ActiveAE/ActiveAEResampleFFMPEG.h)
104 endif()
106 if(CORE_SYSTEM_NAME MATCHES windows)
107   list(APPEND SOURCES Sinks/AESinkWASAPI.cpp
108                       Sinks/AESinkXAudio.cpp
109                       Sinks/windows/AESinkFactoryWin.cpp
110                       Sinks/windows/AESinkFactoryWinRT.cpp)
111   list(APPEND HEADERS Sinks/AESinkWASAPI.h
112                       Sinks/AESinkXAudio.h
113                       Sinks/windows/AESinkFactoryWin.h)
115   if(CORE_SYSTEM_NAME STREQUAL windowsstore)
116     list(APPEND SOURCES Sinks/windows/AESinkFactoryWin10.cpp)
117   else()
118     list(APPEND SOURCES Sinks/AESinkDirectSound.cpp
119                         Sinks/windows/AESinkFactoryWin32.cpp)
120     list(APPEND HEADERS Sinks/AESinkDirectSound.h)
121   endif()
122 endif()
124 if(CORE_SYSTEM_NAME STREQUAL osx)
125   list(APPEND SOURCES Sinks/AESinkDARWINOSX.cpp
126                       Sinks/darwin/CoreAudioHelpers.cpp
127                       Sinks/osx/AEDeviceEnumerationOSX.cpp
128                       Sinks/osx/CoreAudioChannelLayout.cpp
129                       Sinks/osx/CoreAudioDevice.cpp
130                       Sinks/osx/CoreAudioHardware.cpp
131                       Sinks/osx/CoreAudioStream.cpp)
132   list(APPEND HEADERS Sinks/AESinkDARWINOSX.h
133                       Sinks/darwin/CoreAudioHelpers.h
134                       Sinks/osx/AEDeviceEnumerationOSX.h
135                       Sinks/osx/CoreAudioChannelLayout.h
136                       Sinks/osx/CoreAudioDevice.h
137                       Sinks/osx/CoreAudioHardware.h
138                       Sinks/osx/CoreAudioStream.h)
139 endif()
141 if(CORE_SYSTEM_NAME STREQUAL darwin_embedded)
142   list(APPEND SOURCES Sinks/darwin/CoreAudioHelpers.cpp)
143   list(APPEND HEADERS Sinks/darwin/CoreAudioHelpers.h)
144   if("ios" IN_LIST CORE_PLATFORM_NAME_LC)
145     list(APPEND SOURCES Sinks/AESinkDARWINIOS.mm)
146     list(APPEND HEADERS Sinks/AESinkDARWINIOS.h)
147   elseif("tvos" IN_LIST CORE_PLATFORM_NAME_LC)
148     list(APPEND SOURCES Sinks/AESinkDARWINTVOS.mm)
149     list(APPEND HEADERS Sinks/AESinkDARWINTVOS.h)
150   endif()
151 endif()
153 if(CORE_SYSTEM_NAME STREQUAL android)
154   list(APPEND SOURCES Sinks/AESinkAUDIOTRACK.cpp)
155   list(APPEND HEADERS Sinks/AESinkAUDIOTRACK.h)
156 endif()
158 if("webos" IN_LIST CORE_PLATFORM_NAME_LC)
159   list(APPEND SOURCES Sinks/AESinkStarfish.cpp)
160   list(APPEND HEADERS Sinks/AESinkStarfish.h)
161 endif()
163 if(CORE_SYSTEM_NAME STREQUAL freebsd)
164   list(APPEND SOURCES Sinks/AESinkOSS.cpp)
165   list(APPEND HEADERS Sinks/AESinkOSS.h)
166 endif()
168 core_add_library(audioengine)
169 target_include_directories(${CORE_LIBRARY} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
170 if(NOT CORE_SYSTEM_NAME STREQUAL windows AND NOT CORE_SYSTEM_NAME STREQUAL windowsstore)
171   if(HAVE_SSE)
172     target_compile_options(${CORE_LIBRARY} PRIVATE -msse)
173   endif()
174   if(HAVE_SSE2)
175     target_compile_options(${CORE_LIBRARY} PRIVATE -msse2)
176   endif()
177 endif()