From 37ea2156ddc82dbbd0be79280b3df78afb52f4db Mon Sep 17 00:00:00 2001 From: Eric Helgeson Date: Tue, 25 Nov 2025 08:08:16 -0600 Subject: [PATCH] cmake: add warning if no audio libs are detected User may still want to build and detect at runtime, but we should let them know it may cause runtime issues. --- CMakeLists.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index b1c5a6e01c..ee549c749c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,6 +97,21 @@ if (NOT EMSCRIPTEN) set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libraries") set(BUILD_TOOLS OFF CACHE BOOL "Build Cubeb tools") add_subdirectory(thirdparty/cubeb EXCLUDE_FROM_ALL) + + # Warn if no audio backends were detected on Linux/Unix systems + if (UNIX AND NOT APPLE) + if (NOT USE_PULSE AND NOT USE_ALSA AND NOT USE_JACK AND + NOT USE_SNDIO AND NOT USE_OSS AND NOT USE_SUN) + message(WARNING + "No Cubeb audio backends detected on Linux/Unix system!\n" + "Audio will NOT work at runtime.\n" + "Please install development headers for at least one of:\n" + " - PulseAudio (libpulse-dev / pulseaudio-libs-devel)\n" + " - ALSA (libasound2-dev / alsa-lib-devel)\n" + " - JACK (libjack-dev / jack-audio-connection-kit-devel)\n" + " - sndio (libsndio-dev)") + endif() + endif() endif() set(CLI11_ROOT ${PROJECT_SOURCE_DIR}/thirdparty/CLI11)