From 9253f7d645c891cb57a8785bdaeb93d02a80f307 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Tue, 22 Oct 2019 23:59:09 +0200 Subject: [PATCH] =?UTF-8?q?Audio:=20don=E2=80=99t=20build=20XAudio2=20back?= =?UTF-8?q?end=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- rpcs3/Emu/Audio/XAudio2/XAudio27Backend.cpp | 6 +++--- rpcs3/Emu/Audio/XAudio2/XAudio28Backend.cpp | 6 +++--- rpcs3/Emu/Audio/XAudio2/XAudio2Backend.cpp | 6 +++--- rpcs3/Emu/Audio/XAudio2/XAudio2Backend.h | 6 +++--- rpcs3/Emu/CMakeLists.txt | 8 +++++--- 5 files changed, 17 insertions(+), 15 deletions(-) diff --git a/rpcs3/Emu/Audio/XAudio2/XAudio27Backend.cpp b/rpcs3/Emu/Audio/XAudio2/XAudio27Backend.cpp index b0937f8b04..c525bb7826 100644 --- a/rpcs3/Emu/Audio/XAudio2/XAudio27Backend.cpp +++ b/rpcs3/Emu/Audio/XAudio2/XAudio27Backend.cpp @@ -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 diff --git a/rpcs3/Emu/Audio/XAudio2/XAudio28Backend.cpp b/rpcs3/Emu/Audio/XAudio2/XAudio28Backend.cpp index 485e1a90be..22c2539d87 100644 --- a/rpcs3/Emu/Audio/XAudio2/XAudio28Backend.cpp +++ b/rpcs3/Emu/Audio/XAudio2/XAudio28Backend.cpp @@ -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 diff --git a/rpcs3/Emu/Audio/XAudio2/XAudio2Backend.cpp b/rpcs3/Emu/Audio/XAudio2/XAudio2Backend.cpp index ff0baebc8a..fd01402d75 100644 --- a/rpcs3/Emu/Audio/XAudio2/XAudio2Backend.cpp +++ b/rpcs3/Emu/Audio/XAudio2/XAudio2Backend.cpp @@ -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 diff --git a/rpcs3/Emu/Audio/XAudio2/XAudio2Backend.h b/rpcs3/Emu/Audio/XAudio2/XAudio2Backend.h index 5f8aad2afe..f03cf17d70 100644 --- a/rpcs3/Emu/Audio/XAudio2/XAudio2Backend.h +++ b/rpcs3/Emu/Audio/XAudio2/XAudio2Backend.h @@ -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 diff --git a/rpcs3/Emu/CMakeLists.txt b/rpcs3/Emu/CMakeLists.txt index 5b45c81aec..c787a66870 100644 --- a/rpcs3/Emu/CMakeLists.txt +++ b/rpcs3/Emu/CMakeLists.txt @@ -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()