From 55c390506f96c2f8f53336a3641f89461972607e Mon Sep 17 00:00:00 2001 From: crueter Date: Wed, 27 Aug 2025 13:08:55 -0400 Subject: [PATCH] [cmake] separate cubeb Signed-off-by: crueter --- CMakeLists.txt | 57 ++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 30 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 84318291c6..c9883ac195 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -453,32 +453,6 @@ if (YUZU_USE_CPM) # Opus AddJsonPackage(opus) - - if(ENABLE_CUBEB) - AddJsonPackage(cubeb) - - if (cubeb_ADDED) - if (NOT MSVC) - if (TARGET speex) - target_compile_options(speex PRIVATE -Wno-sign-compare) - endif() - - set_target_properties(cubeb PROPERTIES COMPILE_OPTIONS "") - target_compile_options(cubeb INTERFACE - -Wno-implicit-const-int-float-conversion - -Wno-shadow - -Wno-missing-declarations - -Wno-return-type - -Wno-uninitialized - ) - else() - target_compile_options(cubeb PRIVATE - /wd4456 - /wd4458 - ) - endif() - endif() - endif() else() # Enforce the search mode of non-required packages for better and shorter failure messages find_package(fmt 8 REQUIRED) @@ -492,10 +466,6 @@ else() find_package(ZLIB 1.2 REQUIRED) find_package(zstd 1.5 REQUIRED) - if (ENABLE_CUBEB) - find_package(cubeb CONFIG) - endif() - if (YUZU_TESTS) find_package(Catch2 3.0.1 REQUIRED) endif() @@ -532,6 +502,33 @@ endif() # SimpleIni AddJsonPackage(simpleini) +# Most linux distros don't package cubeb, so enable regardless of cpm settings +if(ENABLE_CUBEB) + AddJsonPackage(cubeb) + + if (cubeb_ADDED) + if (NOT MSVC) + if (TARGET speex) + target_compile_options(speex PRIVATE -Wno-sign-compare) + endif() + + set_target_properties(cubeb PROPERTIES COMPILE_OPTIONS "") + target_compile_options(cubeb INTERFACE + -Wno-implicit-const-int-float-conversion + -Wno-shadow + -Wno-missing-declarations + -Wno-return-type + -Wno-uninitialized + ) + else() + target_compile_options(cubeb PRIVATE + /wd4456 + /wd4458 + ) + endif() + endif() +endif() + # TODO(crueter): Work around this if (NOT YUZU_USE_EXTERNAL_VULKAN_SPIRV_TOOLS) find_package(PkgConfig REQUIRED)