Fix build without pulseaudio.

This commit is contained in:
orbea 2020-11-28 19:47:33 -08:00 committed by Kojin
parent 76c98e7140
commit 3b073343cc
3 changed files with 16 additions and 4 deletions

View File

@ -203,7 +203,6 @@ if(PULSEAUDIO_FOUND)
include_directories(${PULSEAUDIO_INCLUDE_DIR})
endif()
if(LIBXML2_FOUND)
include_directories(${LIBXML2_INCLUDE_DIRS})
endif()

View File

@ -48,6 +48,10 @@ if(PORTAUDIO_FOUND)
set(pcsx2FinalFlags ${pcsx2FinalFlags} -DSPU2X_PORTAUDIO)
endif()
if(PULSEAUDIO_FOUND)
set(pcsx2FinalFlags ${pcsx2FinalFlags} -DSPU2X_PULSEAUDIO)
endif()
if(XDG_STD)
set(pcsx2FinalFlags ${pcsx2FinalFlags} -DXDG_STD)
endif()
@ -370,7 +374,6 @@ set(pcsx2USBSources
USB/linux/config-gtk.cpp
USB/linux/util.cpp
USB/qemu-usb/input-keymap-linux-to-qcode.cpp
USB/usb-mic/audiodev-pulse.cpp
USB/usb-pad/api_init_linux.cpp
USB/usb-eyetoy/api_init_linux.cpp
USB/usb-hid/api_init_linux.cpp
@ -432,9 +435,12 @@ set(pcsx2USBHeaders
USB/usb-hid/evdev/evdev.cpp
USB/usb-eyetoy/cam-linux.h
USB/qemu-usb/input-keymap-linux-to-qcode.h
USB/usb-mic/audiodev-pulse.h
)
if(PULSEAUDIO_FOUND)
set(pcsx2USBSources ${pcsx2USBSources} USB/usb-mic/audiodev-pulse.cpp)
set(pcsx2USBHeaders ${pcsx2USBHeaders} USB/usb-mic/audiodev-pulse.h)
endif()
# DebugTools sources
set(pcsx2DebugToolsSources
@ -944,7 +950,6 @@ set(pcsx2FinalLibs
${SDL2_LIBRARIES}
${PCAP_LIBRARY}
${LIBSAMPLERATE_LIBRARIES}
${PULSEAUDIO_LIBRARIES}
${LIBXML2_LIBRARIES}
${Platform_Libs}
)
@ -953,6 +958,10 @@ if(PORTAUDIO_FOUND)
set(pcsx2FinalLibs ${pcsx2FinalLibs} ${PORTAUDIO_LIBRARIES})
endif()
if(PULSEAUDIO_FOUND)
set(pcsx2FinalLibs ${pcsx2FinalLibs} ${PULSEAUDIO_LIBRARIES})
endif()
if(BUILTIN_GS)
set(pcsx2FinalLibs "${pcsx2FinalLibs} GSdx")
endif()

View File

@ -15,11 +15,15 @@
#include "audiodeviceproxy.h"
#include "audiodev-noop.h"
#ifdef SPU2X_PULSEAUDIO
#include "audiodev-pulse.h"
#endif
void usb_mic::RegisterAudioDevice::Register()
{
auto& inst = RegisterAudioDevice::instance();
inst.Add(audiodev_noop::APINAME, new AudioDeviceProxy<audiodev_noop::NoopAudioDevice>());
#ifdef SPU2X_PULSEAUDIO
inst.Add(audiodev_pulse::APINAME, new AudioDeviceProxy<audiodev_pulse::PulseAudioDevice>());
#endif
}