From d8e462b80081787f96839e923838b4572dd50254 Mon Sep 17 00:00:00 2001 From: halx99 Date: Thu, 13 Nov 2025 08:53:39 +0800 Subject: [PATCH] Switch default backend on iOS/macOS from OpenAL.framework to openal-soft - OpenAL.framework has long been deprecated by Apple - openal-soft is now the enforced default backend for native platforms - Removed obsolete CMake option `-DAX_USE_ALSOFT` --- 3rdparty/CMakeLists.txt | 3 +-- CMakeOptions.md | 3 --- cmake/Modules/AXBuildHelpers.cmake | 2 +- cmake/Modules/AXConfigDepend.cmake | 10 ---------- cmake/Modules/AXLinkHelpers.cmake | 1 - core/CMakeLists.txt | 6 ------ core/audio/CMakeLists.txt | 2 +- 7 files changed, 3 insertions(+), 24 deletions(-) diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt index 5b0a27a2705e..1c81ce5dbfb5 100644 --- a/3rdparty/CMakeLists.txt +++ b/3rdparty/CMakeLists.txt @@ -253,7 +253,7 @@ endif() if(AX_ENABLE_AUDIO) # The openal-soft(LGPL 2.1) - if(AX_USE_ALSOFT AND NOT EMSCRIPTEN) + if(NOT EMSCRIPTEN) set(alsoft_opts "ALSOFT_DLOPEN OFF" "ALSOFT_UTILS OFF" "ALSOFT_EXAMPLES OFF" "ALSOFT_INSTALL OFF") if(AX_USE_ALSOFT_STATIC) @@ -289,7 +289,6 @@ if(AX_ENABLE_AUDIO) ax_add_3rd(openal EXCLUDE_FROM_ALL TARGETS alcommon;OpenAL OPTIONS ${alsoft_opts}) target_include_directories(3rdparty INTERFACE openal) - target_compile_definitions(3rdparty INTERFACE AX_USE_ALSOFT=1) set_target_properties(OpenAL alcommon PROPERTIES CXX_STANDARD ${_AX_CXX_STD}) if(AX_USE_ALSOFT_STATIC) diff --git a/CMakeOptions.md b/CMakeOptions.md index 429ae6fa16f5..044fdce7be7b 100644 --- a/CMakeOptions.md +++ b/CMakeOptions.md @@ -16,9 +16,6 @@ - AX_ENABLE_CONSOLE: whether to enable debug tool console support, default: `TRUE` - AX_ENABLE_OPUS: whether to enable audio engine play .opus files support, default: `TRUE` - AX_USE_XXX: - - AX_USE_ALSOFT: whether use openal-soft for all platforms - - Apple platform: Use openal-soft instead system deprecated: `OpenAL.framework` - - Other platforms: Always use openal-soft even this option not enabled - AX_USE_LUAJIT: whether use luajit, default: `FALSE`, use plainlua - AX_ENABLE_EXT_XXX for extensions - AX_ENABLE_EXT_GUI: the traditional GUI extension, default: `TRUE` diff --git a/cmake/Modules/AXBuildHelpers.cmake b/cmake/Modules/AXBuildHelpers.cmake index 60d650966b12..dc52f6c4c18b 100644 --- a/cmake/Modules/AXBuildHelpers.cmake +++ b/cmake/Modules/AXBuildHelpers.cmake @@ -519,7 +519,7 @@ function(ax_setup_app_config app_name) target_link_libraries(${app_name} ${_AX_EXTENSION_LIBS}) - if(XCODE AND AX_ENABLE_AUDIO AND AX_USE_ALSOFT AND ALSOFT_OSX_FRAMEWORK) + if(XCODE AND AX_ENABLE_AUDIO AND ALSOFT_OSX_FRAMEWORK) # Embedded soft_oal embedded framework # XCODE_LINK_BUILD_PHASE_MODE BUILT_ONLY # ???Xcode limition: XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY works for first app diff --git a/cmake/Modules/AXConfigDepend.cmake b/cmake/Modules/AXConfigDepend.cmake index e0226c6c9f1d..1c1b37c69d70 100644 --- a/cmake/Modules/AXConfigDepend.cmake +++ b/cmake/Modules/AXConfigDepend.cmake @@ -2,8 +2,6 @@ macro(ax_depend) # confim the libs, prepare to link set(PLATFORM_SPECIFIC_LIBS) - message(STATUS "AX_USE_ALSOFT=${AX_USE_ALSOFT}") - if(WINDOWS) list(APPEND PLATFORM_SPECIFIC_LIBS ws2_32 userenv psapi winmm Version Iphlpapi) @@ -48,14 +46,6 @@ macro(ax_depend) ${COREMEDIA_LIBRARY} ) - if(AX_ENABLE_AUDIO AND NOT AX_USE_ALSOFT) - find_library(OPENAL_LIBRARY OpenAL) - set(_AX_APPLE_LIBS - ${OPENAL_LIBRARY} - ${_AX_APPLE_LIBS} - ) - endif() - if(MACOSX) list(APPEND PREBUILT_SPECIFIC_LIBS GLFW3) diff --git a/cmake/Modules/AXLinkHelpers.cmake b/cmake/Modules/AXLinkHelpers.cmake index 5049bf124150..90610fbcb053 100644 --- a/cmake/Modules/AXLinkHelpers.cmake +++ b/cmake/Modules/AXLinkHelpers.cmake @@ -58,7 +58,6 @@ function(ax_link_cxx_prebuilt APP_NAME AX_ROOT_DIR AX_PREBUILT_DIR) PRIVATE CP_USE_CGTYPES=0 ) - ax_config_pred(${APP_NAME} AX_USE_ALSOFT) ax_config_pred(${APP_NAME} AX_ENABLE_MSEDGE_WEBVIEW2) ax_config_pred(${APP_NAME} AX_ENABLE_PHYSICS) ax_config_pred(${APP_NAME} AX_ENABLE_3D) diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 97660d327489..b49e06820ea8 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -99,12 +99,6 @@ cmake_dependent_option(AX_ENABLE_MSEDGE_WEBVIEW2 "Use Microsoft Edge webview2" O cmake_dependent_option(AX_ENABLE_MFMEDIA "Enabling microsoft media foundation" ON "WIN32" OFF) cmake_dependent_option(AX_ENABLE_VLC_MEDIA "Enabling vlc media" OFF "(WIN32 AND NOT WINRT) OR LINUX" OFF) -if(NOT APPLE AND(NOT EMSCRIPTEN)) - set(AX_USE_ALSOFT ON CACHE BOOL "" FORCE) -else() - option(AX_USE_ALSOFT "Use ALSOFT on apple" OFF) -endif() - option(AX_ENABLE_PHYSICS "Build Physics support" ON) cmake_dependent_option(AX_ENABLE_MEDIA "Build media support" ON "AX_ENABLE_MFMEDIA OR AX_ENABLE_VLC_MEDIA OR APPLE OR ANDROID" OFF) option(AX_ENABLE_AUDIO "Build audio support" ON) diff --git a/core/audio/CMakeLists.txt b/core/audio/CMakeLists.txt index 60f6197bf4f7..cf707ed7c636 100644 --- a/core/audio/CMakeLists.txt +++ b/core/audio/CMakeLists.txt @@ -24,7 +24,7 @@ set(_AX_AUDIO_SRC audio/AudioEngineImpl.cpp ) -if (AX_USE_ALSOFT) +if (NOT EMSCRIPTEN) set(_AX_AUDIO_HEADER ${_AX_AUDIO_HEADER} audio/AudioEffectsExtension.h )