ladybird/Meta/CMake/audio.cmake
Timothy Flynn 79a2b96d1c Meta: Consolidate checking for the system audio backend
The goal here is to ensure we check for audio backends in a way that
makes sense. On macOS, let's just always use Audio Unit (and thus avoid
any checks for Pulse, to reduce needless/confusing build log noise). We
will also only use the Qt audio backend if no other backend was found,
rather than only checking for Pulse.
2024-12-25 12:00:43 +01:00

20 lines
493 B
CMake

include_guard()
# Audio backend -- how we output audio to the speakers.
if (APPLE AND NOT IOS)
set(LADYBIRD_AUDIO_BACKEND "AUDIO_UNIT")
return()
elseif (ANDROID)
set(LADYBIRD_AUDIO_BACKEND "OBOE")
return()
elseif (NOT WIN32)
find_package(PkgConfig REQUIRED)
pkg_check_modules(PULSEAUDIO IMPORTED_TARGET libpulse)
if (PULSEAUDIO_FOUND)
set(LADYBIRD_AUDIO_BACKEND "PULSE")
return()
endif()
endif()
message(WARNING "No audio backend available")