cmake: Don't link with PulseAudio when disabled

Don't search for, or link with the PulseAudio library when
DISABLE_PULSEAUDIO is true, and set as REQUIRED when false.

Closes https://github.com/obsproject/obs-studio/issues/4025
This commit is contained in:
Jimi Huotari 2021-10-07 11:03:49 +03:00 committed by Matt Gajownik
parent e6a3d2b8f2
commit 9d6ecc8beb

View File

@ -28,8 +28,8 @@ if(UNIX)
else()
set(USE_XINPUT "0")
endif()
find_package(PulseAudio)
if (NOT "${PULSEAUDIO_LIBRARY}" STREQUAL "")
if (NOT DISABLE_PULSEAUDIO)
find_package(PulseAudio REQUIRED)
message(STATUS "Found PulseAudio - Audio Monitor enabled")
set(HAVE_PULSEAUDIO "1")
else()