From 49252a021758e3135e078aec1e52305dea360287 Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Sat, 26 Nov 2022 05:08:27 +0100 Subject: [PATCH] Externals: Update cubeb to mozilla/cubeb@27d2a102b0b75d9e49d43bc1ea516233fb87d778. --- Externals/cubeb/CMakeLists.txt | 31 ++++++++++++++++-------------- Externals/cubeb/cubeb | 2 +- Externals/cubeb/msvc/cubeb.vcxproj | 2 +- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/Externals/cubeb/CMakeLists.txt b/Externals/cubeb/CMakeLists.txt index b3eccb548e..a9f904a093 100644 --- a/Externals/cubeb/CMakeLists.txt +++ b/Externals/cubeb/CMakeLists.txt @@ -125,7 +125,7 @@ if(NOT BUNDLE_SPEEX) endif() if(NOT TARGET speex) - add_library(speex STATIC cubeb/subprojects/speex/resample.c) + add_library(speex OBJECT cubeb/subprojects/speex/resample.c) dolphin_disable_warnings_msvc(speex) set_target_properties(speex PROPERTIES POSITION_INDEPENDENT_CODE TRUE) target_include_directories(speex INTERFACE cubeb/subprojects) @@ -273,9 +273,22 @@ if(HAVE_SYS_SOUNDCARD_H) try_compile(USE_OSS "${PROJECT_BINARY_DIR}/compile_tests" ${PROJECT_SOURCE_DIR}/cubeb/cmake/compile_tests/oss_is_v4.c) if(USE_OSS) - target_sources(cubeb PRIVATE - cubeb/src/cubeb_oss.c) - target_compile_definitions(cubeb PRIVATE USE_OSS) + # strlcpy is not available on BSD systems that use glibc, + # like Debian kfreebsd, so try using libbsd if available + include(CheckSymbolExists) + check_symbol_exists(strlcpy string.h HAVE_STRLCPY) + if(NOT HAVE_STRLCPY) + pkg_check_modules(libbsd-overlay IMPORTED_TARGET libbsd-overlay) + if(libbsd-overlay_FOUND) + target_link_libraries(cubeb PRIVATE PkgConfig::libbsd-overlay) + set(HAVE_STRLCPY true) + endif() + endif() + if (HAVE_STRLCPY) + target_sources(cubeb PRIVATE + cubeb/src/cubeb_oss.c) + target_compile_definitions(cubeb PRIVATE USE_OSS) + endif() endif() endif() @@ -339,13 +352,3 @@ if(USE_AUDIOUNIT AND USE_AUDIOUNIT_RUST) debug "${PROJECT_SOURCE_DIR}/cubeb/src/cubeb-coreaudio-rs/target/debug/libcubeb_coreaudio.a" optimized "${PROJECT_SOURCE_DIR}/cubeb/src/cubeb-coreaudio-rs/target/release/libcubeb_coreaudio.a") endif() - -find_package(Doxygen) -if(DOXYGEN_FOUND) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/docs/Doxyfile @ONLY) - add_custom_target(doc ALL - ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/docs/Doxyfile - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/docs - COMMENT "Generating API documentation with Doxygen" VERBATIM) -endif() - diff --git a/Externals/cubeb/cubeb b/Externals/cubeb/cubeb index 773f16b7ea..27d2a102b0 160000 --- a/Externals/cubeb/cubeb +++ b/Externals/cubeb/cubeb @@ -1 +1 @@ -Subproject commit 773f16b7ea308392c05be3e290163d1f636e6024 +Subproject commit 27d2a102b0b75d9e49d43bc1ea516233fb87d778 diff --git a/Externals/cubeb/msvc/cubeb.vcxproj b/Externals/cubeb/msvc/cubeb.vcxproj index 7d5f3c85b2..c35fd82128 100644 --- a/Externals/cubeb/msvc/cubeb.vcxproj +++ b/Externals/cubeb/msvc/cubeb.vcxproj @@ -40,13 +40,13 @@ + -