Merge pull request #4487 from linkmauve/optional-dependencies
Add cmake options to disable optional dependencies
This commit is contained in:
commit
a9eaaea19c
114
CMakeLists.txt
114
CMakeLists.txt
|
@ -15,6 +15,12 @@ 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)
|
||||||
|
option(ENABLE_LLVM "Enables LLVM support, for disassembly" ON)
|
||||||
|
option(ENABLE_BLUEZ "Enables bluetooth support" 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,61 +451,83 @@ if (OPENGL_GL)
|
||||||
include_directories(${OPENGL_INCLUDE_DIR})
|
include_directories(${OPENGL_INCLUDE_DIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include(FindALSA OPTIONAL)
|
if(ENABLE_ALSA)
|
||||||
if(ALSA_FOUND)
|
include(FindALSA OPTIONAL)
|
||||||
add_definitions(-DHAVE_ALSA=1)
|
if(ALSA_FOUND)
|
||||||
message("ALSA found, enabling ALSA sound backend")
|
add_definitions(-DHAVE_ALSA=1)
|
||||||
|
message("ALSA found, enabling ALSA sound backend")
|
||||||
|
else()
|
||||||
|
add_definitions(-DHAVE_ALSA=0)
|
||||||
|
message("ALSA NOT found, disabling ALSA sound backend")
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
add_definitions(-DHAVE_ALSA=0)
|
message("ALSA explicitly disabled, disabling ALSA sound backend")
|
||||||
message("ALSA NOT found, disabling ALSA sound backend")
|
endif()
|
||||||
endif(ALSA_FOUND)
|
|
||||||
|
|
||||||
check_lib(AO ao ao QUIET)
|
if(ENABLE_AO)
|
||||||
if(AO_FOUND)
|
check_lib(AO ao ao QUIET)
|
||||||
add_definitions(-DHAVE_AO=1)
|
if(AO_FOUND)
|
||||||
message("ao found, enabling ao sound backend")
|
add_definitions(-DHAVE_AO=1)
|
||||||
|
message("ao found, enabling ao sound backend")
|
||||||
|
else()
|
||||||
|
add_definitions(-DHAVE_AO=0)
|
||||||
|
message("ao NOT found, disabling ao sound backend")
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
add_definitions(-DHAVE_AO=0)
|
message("ao explicitly disabled, disabling ao sound backend")
|
||||||
message("ao NOT found, disabling ao sound backend")
|
endif()
|
||||||
endif(AO_FOUND)
|
|
||||||
|
|
||||||
check_lib(BLUEZ bluez bluez QUIET)
|
if(ENABLE_BLUEZ)
|
||||||
if(BLUEZ_FOUND)
|
check_lib(BLUEZ bluez bluez QUIET)
|
||||||
add_definitions(-DHAVE_BLUEZ=1)
|
if(BLUEZ_FOUND)
|
||||||
message("bluez found, enabling bluetooth support")
|
add_definitions(-DHAVE_BLUEZ=1)
|
||||||
|
message("bluez found, enabling bluetooth support")
|
||||||
|
else()
|
||||||
|
add_definitions(-DHAVE_BLUEZ=0)
|
||||||
|
message("bluez NOT found, disabling bluetooth support")
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
add_definitions(-DHAVE_BLUEZ=0)
|
message("bluez explicitly disabled, disabling bluetooth support")
|
||||||
message("bluez NOT found, disabling bluetooth support")
|
endif()
|
||||||
endif(BLUEZ_FOUND)
|
|
||||||
|
|
||||||
check_lib(PULSEAUDIO libpulse pulse QUIET)
|
if(ENABLE_PULSEAUDIO)
|
||||||
if(PULSEAUDIO_FOUND)
|
check_lib(PULSEAUDIO libpulse pulse QUIET)
|
||||||
add_definitions(-DHAVE_PULSEAUDIO=1)
|
if(PULSEAUDIO_FOUND)
|
||||||
message("PulseAudio found, enabling PulseAudio sound backend")
|
add_definitions(-DHAVE_PULSEAUDIO=1)
|
||||||
|
message("PulseAudio found, enabling PulseAudio sound backend")
|
||||||
|
else()
|
||||||
|
add_definitions(-DHAVE_PULSEAUDIO=0)
|
||||||
|
message("PulseAudio NOT found, disabling PulseAudio sound backend")
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
add_definitions(-DHAVE_PULSEAUDIO=0)
|
message("PulseAudio explicitly disabled, disabling PulseAudio sound backend")
|
||||||
message("PulseAudio NOT found, disabling PulseAudio sound backend")
|
endif()
|
||||||
endif(PULSEAUDIO_FOUND)
|
|
||||||
|
|
||||||
include(FindOpenAL OPTIONAL)
|
if(ENABLE_OPENAL)
|
||||||
if(OPENAL_FOUND)
|
include(FindOpenAL OPTIONAL)
|
||||||
add_definitions(-DHAVE_OPENAL=1)
|
if(OPENAL_FOUND)
|
||||||
include_directories(${OPENAL_INCLUDE_DIR})
|
add_definitions(-DHAVE_OPENAL=1)
|
||||||
message("OpenAL found, enabling OpenAL sound backend")
|
include_directories(${OPENAL_INCLUDE_DIR})
|
||||||
|
message("OpenAL found, enabling OpenAL sound backend")
|
||||||
|
else()
|
||||||
|
add_definitions(-DHAVE_OPENAL=0)
|
||||||
|
message("OpenAL NOT found, disabling OpenAL sound backend")
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
add_definitions(-DHAVE_OPENAL=0)
|
message("OpenAL explicitly disabled, disabling OpenAL sound backend")
|
||||||
message("OpenAL NOT found, disabling OpenAL sound backend")
|
endif()
|
||||||
endif(OPENAL_FOUND)
|
|
||||||
|
|
||||||
include(FindLLVM OPTIONAL)
|
if(ENABLE_LLVM)
|
||||||
if (LLVM_FOUND)
|
include(FindLLVM OPTIONAL)
|
||||||
add_definitions(-DHAS_LLVM=1)
|
if (LLVM_FOUND)
|
||||||
set(HAS_LLVM 1)
|
add_definitions(-DHAS_LLVM=1)
|
||||||
|
set(HAS_LLVM 1)
|
||||||
|
|
||||||
include_directories(${LLVM_INCLUDE_DIRS})
|
include_directories(${LLVM_INCLUDE_DIRS})
|
||||||
list(APPEND LIBS ${LLVM_LIBRARIES})
|
list(APPEND LIBS ${LLVM_LIBRARIES})
|
||||||
|
|
||||||
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
|
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(USE_X11 0)
|
set(USE_X11 0)
|
||||||
|
|
Loading…
Reference in New Issue