Audio: don’t build XAudio2 backend on Linux

The files already had a #ifdef _WIN32, but this avoid even trying to
compile their translation unit.

I was surprised to see XAudio2 being mentioned on Linux, this makes sure
no one else will get this surprise.
This commit is contained in:
Emmanuel Gil Peyrot 2019-10-22 23:59:09 +02:00 committed by Ivan
parent a360836fef
commit 9253f7d645
5 changed files with 17 additions and 15 deletions

View File

@ -1,4 +1,6 @@
#ifdef _WIN32
#ifndef _WIN32
#error "XAudio27 can only be built on Windows."
#endif
#include "Utilities/Log.h"
#include "Utilities/StrFmt.h"
@ -199,5 +201,3 @@ XAudio2Backend::XAudio2Library* XAudio2Backend::xa27_init(void* lib2_7)
{
return new XAudio27Library(lib2_7);
}
#endif

View File

@ -1,4 +1,6 @@
#ifdef _WIN32
#ifndef _WIN32
#error "XAudio28 can only be built on Windows."
#endif
#include "Utilities/Log.h"
#include "Utilities/StrFmt.h"
@ -211,5 +213,3 @@ XAudio2Backend::XAudio2Library* XAudio2Backend::xa28_init(void* lib2_8)
{
return new XAudio28Library(lib2_8);
}
#endif

View File

@ -1,4 +1,6 @@
#ifdef _WIN32
#ifndef _WIN32
#error "XAudio2 can only be built on Windows."
#endif
#include "Utilities/Log.h"
#include "Utilities/StrFmt.h"
@ -88,5 +90,3 @@ f32 XAudio2Backend::SetFrequencyRatio(f32 new_ratio)
{
return lib->set_freq_ratio(new_ratio);
}
#endif

View File

@ -1,6 +1,8 @@
#pragma once
#ifdef _WIN32
#ifndef _WIN32
#error "XAudio2 can only be built on Windows."
#endif
#include "Emu/Audio/AudioBackend.h"
@ -49,5 +51,3 @@ public:
virtual u64 GetNumEnqueuedSamples() override;
virtual f32 SetFrequencyRatio(f32 new_ratio) override;
};
#endif

View File

@ -90,12 +90,14 @@ target_sources(rpcs3_emu PRIVATE
Audio/AL/OpenALBackend.cpp
Audio/ALSA/ALSABackend.cpp
Audio/Pulse/PulseBackend.cpp
Audio/XAudio2/XAudio27Backend.cpp
Audio/XAudio2/XAudio28Backend.cpp
Audio/XAudio2/XAudio2Backend.cpp
)
if(WIN32)
target_sources(rpcs3_emu PRIVATE
Audio/XAudio2/XAudio27Backend.cpp
Audio/XAudio2/XAudio28Backend.cpp
Audio/XAudio2/XAudio2Backend.cpp
)
# Slimmed down version of minidx9 for XAudio2_7 only
include_directories(BEFORE "${RPCS3_SRC_DIR}/../3rdparty/XAudio2_7")
endif()