From 3290eccb6c30552a50815954a150d7c9094d7a76 Mon Sep 17 00:00:00 2001 From: Takuya Wakazono Date: Mon, 5 May 2025 01:14:03 +0900 Subject: [PATCH 1/2] Fix USE_SYSTEM_OPENAL to use system headers Even when USE_SYSTEM_OPENAL was enabled, the code directly included the bundled OpenAL headers, bypassing the system headers. Since `#include ` is not portable, use `#include "al.h"` instead. https://cmake.org/cmake/help/latest/module/FindOpenAL.html --- rpcs3/Emu/Cell/Modules/cellMic.cpp | 2 +- rpcs3/Emu/Cell/Modules/cellMic.h | 3 ++- rpcs3/rpcs3qt/microphone_creator.cpp | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/rpcs3/Emu/Cell/Modules/cellMic.cpp b/rpcs3/Emu/Cell/Modules/cellMic.cpp index a5ece1be59..0724b48927 100644 --- a/rpcs3/Emu/Cell/Modules/cellMic.cpp +++ b/rpcs3/Emu/Cell/Modules/cellMic.cpp @@ -11,7 +11,7 @@ #include #ifndef WITHOUT_OPENAL -#include "3rdparty/OpenAL/openal-soft/include/AL/alext.h" +#include "alext.h" #endif LOG_CHANNEL(cellMic); diff --git a/rpcs3/Emu/Cell/Modules/cellMic.h b/rpcs3/Emu/Cell/Modules/cellMic.h index e4b416fa6a..88a2f4d937 100644 --- a/rpcs3/Emu/Cell/Modules/cellMic.h +++ b/rpcs3/Emu/Cell/Modules/cellMic.h @@ -1,9 +1,10 @@ #pragma once #include "Utilities/Thread.h" -#include "3rdparty/OpenAL/openal-soft/include/AL/alc.h" #include "Utilities/mutex.h" +#include "alc.h" + // Error Codes enum CellMicInError : u32 { diff --git a/rpcs3/rpcs3qt/microphone_creator.cpp b/rpcs3/rpcs3qt/microphone_creator.cpp index 9ea04defde..2821fd82e4 100644 --- a/rpcs3/rpcs3qt/microphone_creator.cpp +++ b/rpcs3/rpcs3qt/microphone_creator.cpp @@ -3,8 +3,8 @@ #include "Utilities/StrUtil.h" -#include "3rdparty/OpenAL/openal-soft/include/AL/al.h" -#include "3rdparty/OpenAL/openal-soft/include/AL/alc.h" +#include "al.h" +#include "alc.h" LOG_CHANNEL(cfg_log, "CFG"); From 68ac05fcb269a7cfacf6159420f6e9fae6602379 Mon Sep 17 00:00:00 2001 From: Takuya Wakazono Date: Wed, 7 May 2025 01:10:23 +0900 Subject: [PATCH 2/2] Set USE_SYSTEM_OPENAL default to OFF on macOS and Windows On Linux, using system libraries is generally preferred, but this is less relevant on macOS and Windows. In particular, macOS does not provide "alext.h" in its OpenAL framework, which causes the build to fail. --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d2edd8365..a9928cc5f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,12 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") endif() endif() +if(APPLE OR WIN32) + set(USE_SYSTEM_OPENAL_DEFAULT OFF) +else() + set(USE_SYSTEM_OPENAL_DEFAULT ON) +endif() + option(USE_NATIVE_INSTRUCTIONS "USE_NATIVE_INSTRUCTIONS makes rpcs3 compile with -march=native, which is useful for local builds, but not good for packages." ON) option(WITH_LLVM "Enable usage of LLVM library" ON) option(BUILD_LLVM "Build LLVM from git submodule" OFF) @@ -28,7 +34,7 @@ option(USE_PRECOMPILED_HEADERS "Use precompiled headers" OFF) option(USE_SDL "Enables SDL input handler" OFF) option(USE_SYSTEM_SDL "Prefer system SDL instead of the builtin one" ON) option(USE_SYSTEM_FFMPEG "Prefer system ffmpeg instead of the prebuild one" OFF) -option(USE_SYSTEM_OPENAL "Prefer system OpenAL instead of the prebuild one" ON) +option(USE_SYSTEM_OPENAL "Prefer system OpenAL instead of the prebuild one" ${USE_SYSTEM_OPENAL_DEFAULT}) option(USE_SYSTEM_CURL "Prefer system Curl instead of the prebuild one" ON) option(USE_SYSTEM_OPENCV "Prefer system OpenCV instead of the builtin one" ON) option(HAS_MEMORY_BREAKPOINTS "Add support for memory breakpoints to the interpreter" OFF)