CMake: Add an option to disable each sound backend.
They are already disabled when the libraries can’t be found, this only helps people who want to build without them despite having them installed, for example to provide a package to someone else.
This commit is contained in:
parent
8e506cb974
commit
6033250beb
|
@ -15,6 +15,10 @@ option(ENABLE_PCH "Use PCH to speed up compilation" ON)
|
||||||
option(ENABLE_LTO "Enables Link Time Optimization" OFF)
|
option(ENABLE_LTO "Enables Link Time Optimization" OFF)
|
||||||
option(ENABLE_GENERIC "Enables generic build that should run on any little-endian host" OFF)
|
option(ENABLE_GENERIC "Enables generic build that should run on any little-endian host" OFF)
|
||||||
option(ENABLE_HEADLESS "Enables running Dolphin as a headless variant" OFF)
|
option(ENABLE_HEADLESS "Enables running Dolphin as a headless variant" OFF)
|
||||||
|
option(ENABLE_ALSA "Enables ALSA sound backend" ON)
|
||||||
|
option(ENABLE_AO "Enables libao sound backend" ON)
|
||||||
|
option(ENABLE_PULSEAUDIO "Enables PulseAudio sound backend" ON)
|
||||||
|
option(ENABLE_OPENAL "Enables OpenAL sound backend" ON)
|
||||||
|
|
||||||
# Maintainers: if you consider blanket disabling this for your users, please
|
# Maintainers: if you consider blanket disabling this for your users, please
|
||||||
# consider the following points:
|
# consider the following points:
|
||||||
|
@ -445,6 +449,7 @@ if (OPENGL_GL)
|
||||||
include_directories(${OPENGL_INCLUDE_DIR})
|
include_directories(${OPENGL_INCLUDE_DIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(ENABLE_ALSA)
|
||||||
include(FindALSA OPTIONAL)
|
include(FindALSA OPTIONAL)
|
||||||
if(ALSA_FOUND)
|
if(ALSA_FOUND)
|
||||||
add_definitions(-DHAVE_ALSA=1)
|
add_definitions(-DHAVE_ALSA=1)
|
||||||
|
@ -452,8 +457,12 @@ if(ALSA_FOUND)
|
||||||
else()
|
else()
|
||||||
add_definitions(-DHAVE_ALSA=0)
|
add_definitions(-DHAVE_ALSA=0)
|
||||||
message("ALSA NOT found, disabling ALSA sound backend")
|
message("ALSA NOT found, disabling ALSA sound backend")
|
||||||
endif(ALSA_FOUND)
|
endif()
|
||||||
|
else()
|
||||||
|
message("ALSA explicitly disabled, disabling ALSA sound backend")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(ENABLE_AO)
|
||||||
check_lib(AO ao ao QUIET)
|
check_lib(AO ao ao QUIET)
|
||||||
if(AO_FOUND)
|
if(AO_FOUND)
|
||||||
add_definitions(-DHAVE_AO=1)
|
add_definitions(-DHAVE_AO=1)
|
||||||
|
@ -461,7 +470,10 @@ if(AO_FOUND)
|
||||||
else()
|
else()
|
||||||
add_definitions(-DHAVE_AO=0)
|
add_definitions(-DHAVE_AO=0)
|
||||||
message("ao NOT found, disabling ao sound backend")
|
message("ao NOT found, disabling ao sound backend")
|
||||||
endif(AO_FOUND)
|
endif()
|
||||||
|
else()
|
||||||
|
message("ao explicitly disabled, disabling ao sound backend")
|
||||||
|
endif()
|
||||||
|
|
||||||
check_lib(BLUEZ bluez bluez QUIET)
|
check_lib(BLUEZ bluez bluez QUIET)
|
||||||
if(BLUEZ_FOUND)
|
if(BLUEZ_FOUND)
|
||||||
|
@ -472,6 +484,7 @@ else()
|
||||||
message("bluez NOT found, disabling bluetooth support")
|
message("bluez NOT found, disabling bluetooth support")
|
||||||
endif(BLUEZ_FOUND)
|
endif(BLUEZ_FOUND)
|
||||||
|
|
||||||
|
if(ENABLE_PULSEAUDIO)
|
||||||
check_lib(PULSEAUDIO libpulse pulse QUIET)
|
check_lib(PULSEAUDIO libpulse pulse QUIET)
|
||||||
if(PULSEAUDIO_FOUND)
|
if(PULSEAUDIO_FOUND)
|
||||||
add_definitions(-DHAVE_PULSEAUDIO=1)
|
add_definitions(-DHAVE_PULSEAUDIO=1)
|
||||||
|
@ -479,8 +492,12 @@ if(PULSEAUDIO_FOUND)
|
||||||
else()
|
else()
|
||||||
add_definitions(-DHAVE_PULSEAUDIO=0)
|
add_definitions(-DHAVE_PULSEAUDIO=0)
|
||||||
message("PulseAudio NOT found, disabling PulseAudio sound backend")
|
message("PulseAudio NOT found, disabling PulseAudio sound backend")
|
||||||
endif(PULSEAUDIO_FOUND)
|
endif()
|
||||||
|
else()
|
||||||
|
message("PulseAudio explicitly disabled, disabling PulseAudio sound backend")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(ENABLE_OPENAL)
|
||||||
include(FindOpenAL OPTIONAL)
|
include(FindOpenAL OPTIONAL)
|
||||||
if(OPENAL_FOUND)
|
if(OPENAL_FOUND)
|
||||||
add_definitions(-DHAVE_OPENAL=1)
|
add_definitions(-DHAVE_OPENAL=1)
|
||||||
|
@ -489,7 +506,10 @@ if(OPENAL_FOUND)
|
||||||
else()
|
else()
|
||||||
add_definitions(-DHAVE_OPENAL=0)
|
add_definitions(-DHAVE_OPENAL=0)
|
||||||
message("OpenAL NOT found, disabling OpenAL sound backend")
|
message("OpenAL NOT found, disabling OpenAL sound backend")
|
||||||
endif(OPENAL_FOUND)
|
endif()
|
||||||
|
else()
|
||||||
|
message("OpenAL explicitly disabled, disabling OpenAL sound backend")
|
||||||
|
endif()
|
||||||
|
|
||||||
include(FindLLVM OPTIONAL)
|
include(FindLLVM OPTIONAL)
|
||||||
if (LLVM_FOUND)
|
if (LLVM_FOUND)
|
||||||
|
|
Loading…
Reference in New Issue