diff --git a/.gitmodules b/.gitmodules index e5a31311f5..4666da51cd 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,6 @@ # SPDX-FileCopyrightText: 2014 Citra Emulator Project # SPDX-License-Identifier: GPL-2.0-or-later -[submodule "cubeb"] - path = externals/cubeb - url = https://github.com/mozilla/cubeb.git [submodule "Vulkan-Headers"] path = externals/Vulkan-Headers url = https://github.com/KhronosGroup/Vulkan-Headers.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 9761bdc363..8551911f78 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -418,10 +418,6 @@ if (ARCHITECTURE_x86_64 OR ARCHITECTURE_arm64) find_package(dynarmic 6.4.0 CONFIG) endif() -if (ENABLE_CUBEB) - find_package(cubeb CONFIG) -endif() - if (USE_DISCORD_PRESENCE) find_package(DiscordRPC MODULE) endif() diff --git a/CMakeModules/CPM.cmake b/CMakeModules/CPM.cmake index 4937f7457c..84748734ce 100644 --- a/CMakeModules/CPM.cmake +++ b/CMakeModules/CPM.cmake @@ -2,7 +2,6 @@ # # SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors -message(STATUS "CPM JSDFNDFJKNKSDJFNKDSNJKFNDJKNFDJKNKNDFKJN") set(CPM_DOWNLOAD_VERSION 0.42.0) set(CPM_HASH_SUM "2020b4fc42dba44817983e06342e682ecfc3d2f484a581f11cc5731fbe4dce8a") @@ -14,8 +13,6 @@ else() set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake") endif() -message(STATUS "CPM nsdfjknfjkndsfjknsdfjkndkfjnksdjn ${CPM_DOWNLOAD_LOCATION}") - # Expand relative path. This is important if the provided path contains a tilde (~) get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE) diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index f11323f1d5..ea598e3483 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -1,6 +1,9 @@ # SPDX-FileCopyrightText: 2016 Citra Emulator Project # SPDX-License-Identifier: GPL-2.0-or-later +# cpm +include(CPM) + # Dynarmic has cmake_minimum_required(3.12) and we may want to override # some of its variables, which is only possible in 3.13+ set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) @@ -78,7 +81,6 @@ if (YUZU_USE_EXTERNAL_SDL2) set(SDL_FILE ON) endif() - include(CPM) set(CPM_USE_LOCAL_PACKAGES OFF) if ("${YUZU_SYSTEM_PROFILE}" STREQUAL "steamdeck") @@ -98,20 +100,6 @@ if (NOT TARGET enet::enet) add_library(enet::enet ALIAS enet) endif() -# Cubeb -if (ENABLE_CUBEB AND NOT TARGET cubeb::cubeb) - set(BUILD_TESTS OFF) - set(BUILD_TOOLS OFF) - add_subdirectory(cubeb) - add_library(cubeb::cubeb ALIAS cubeb) - if (NOT MSVC) - if (TARGET speex) - target_compile_options(speex PRIVATE -Wno-sign-compare) - endif() - target_compile_options(cubeb PRIVATE -Wno-implicit-const-int-float-conversion) - endif() -endif() - # DiscordRPC if (USE_DISCORD_PRESENCE AND NOT TARGET DiscordRPC::discord-rpc) set(BUILD_EXAMPLES OFF) diff --git a/externals/cubeb b/externals/cubeb deleted file mode 160000 index fa02160712..0000000000 --- a/externals/cubeb +++ /dev/null @@ -1 +0,0 @@ -Subproject commit fa021607121360af7c171d881dc5bc8af7bb56eb diff --git a/src/audio_core/CMakeLists.txt b/src/audio_core/CMakeLists.txt index 8c94109de0..a1e5bdbdcd 100644 --- a/src/audio_core/CMakeLists.txt +++ b/src/audio_core/CMakeLists.txt @@ -232,12 +232,14 @@ if (ARCHITECTURE_x86_64 OR ARCHITECTURE_arm64) endif() if (ENABLE_CUBEB) + add_subdirectory(externals/cubeb) + target_sources(audio_core PRIVATE sink/cubeb_sink.cpp sink/cubeb_sink.h ) - target_link_libraries(audio_core PRIVATE cubeb::cubeb) + target_link_libraries(audio_core PRIVATE cubeb) target_compile_definitions(audio_core PRIVATE -DHAVE_CUBEB=1) endif() diff --git a/src/audio_core/externals/cubeb/CMakeLists.txt b/src/audio_core/externals/cubeb/CMakeLists.txt new file mode 100644 index 0000000000..a32bb5f9e3 --- /dev/null +++ b/src/audio_core/externals/cubeb/CMakeLists.txt @@ -0,0 +1,25 @@ +# SPDX-FileCopyrightText: 2025 Eden Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later + +include(CPM) +set(CPM_USE_LOCAL_PACKAGES ON) +CPMAddPackage( + URI "gh:mozilla/cubeb#fa02160712" + FIND_PACKAGE_ARGUMENTS "CONFIG" # not sure this works outside of gentoo +) + +if (cubeb_ADDED) + set(BUILD_TESTS OFF) + set(BUILD_TOOLS OFF) + + if (NOT MSVC) + if (TARGET speex) + target_compile_options(speex PRIVATE -Wno-sign-compare) + endif() + target_compile_options(cubeb PRIVATE + -Wno-implicit-const-int-float-conversion + -Wno-shadow + -Wno-missing-declarations -Wno-return-type + ) + endif() +endif()