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-08 15:30:22 +11:00
committed by Matt Gajownik
parent e6a3d2b8f2
commit 9d6ecc8beb
+2 -2
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()