From 6033250bebe9f5dcec47c4e2ec8e5d3b102f73e7 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sat, 3 Dec 2016 18:36:34 +0000 Subject: [PATCH 1/3] CMake: Add an option to disable each sound backend. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- CMakeLists.txt | 78 +++++++++++++++++++++++++++++++------------------- 1 file changed, 49 insertions(+), 29 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cc608e7978..f9a3abbe3b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,10 @@ option(ENABLE_PCH "Use PCH to speed up compilation" ON) 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_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 # consider the following points: @@ -445,23 +449,31 @@ if (OPENGL_GL) include_directories(${OPENGL_INCLUDE_DIR}) endif() -include(FindALSA OPTIONAL) -if(ALSA_FOUND) - add_definitions(-DHAVE_ALSA=1) - message("ALSA found, enabling ALSA sound backend") +if(ENABLE_ALSA) + include(FindALSA OPTIONAL) + if(ALSA_FOUND) + 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() - add_definitions(-DHAVE_ALSA=0) - message("ALSA NOT found, disabling ALSA sound backend") -endif(ALSA_FOUND) + message("ALSA explicitly disabled, disabling ALSA sound backend") +endif() -check_lib(AO ao ao QUIET) -if(AO_FOUND) - add_definitions(-DHAVE_AO=1) - message("ao found, enabling ao sound backend") +if(ENABLE_AO) + check_lib(AO ao ao QUIET) + if(AO_FOUND) + 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() - add_definitions(-DHAVE_AO=0) - message("ao NOT found, disabling ao sound backend") -endif(AO_FOUND) + message("ao explicitly disabled, disabling ao sound backend") +endif() check_lib(BLUEZ bluez bluez QUIET) if(BLUEZ_FOUND) @@ -472,24 +484,32 @@ else() message("bluez NOT found, disabling bluetooth support") endif(BLUEZ_FOUND) -check_lib(PULSEAUDIO libpulse pulse QUIET) -if(PULSEAUDIO_FOUND) - add_definitions(-DHAVE_PULSEAUDIO=1) - message("PulseAudio found, enabling PulseAudio sound backend") +if(ENABLE_PULSEAUDIO) + check_lib(PULSEAUDIO libpulse pulse QUIET) + if(PULSEAUDIO_FOUND) + 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() - add_definitions(-DHAVE_PULSEAUDIO=0) - message("PulseAudio NOT found, disabling PulseAudio sound backend") -endif(PULSEAUDIO_FOUND) + message("PulseAudio explicitly disabled, disabling PulseAudio sound backend") +endif() -include(FindOpenAL OPTIONAL) -if(OPENAL_FOUND) - add_definitions(-DHAVE_OPENAL=1) - include_directories(${OPENAL_INCLUDE_DIR}) - message("OpenAL found, enabling OpenAL sound backend") +if(ENABLE_OPENAL) + include(FindOpenAL OPTIONAL) + if(OPENAL_FOUND) + add_definitions(-DHAVE_OPENAL=1) + 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() - add_definitions(-DHAVE_OPENAL=0) - message("OpenAL NOT found, disabling OpenAL sound backend") -endif(OPENAL_FOUND) + message("OpenAL explicitly disabled, disabling OpenAL sound backend") +endif() include(FindLLVM OPTIONAL) if (LLVM_FOUND) From c57f7414a86d412e5081d1c52434206398009928 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sat, 3 Dec 2016 18:37:02 +0000 Subject: [PATCH 2/3] CMake: Add an option to disable LLVM support. This makes the disassembler only work for x86. --- CMakeLists.txt | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f9a3abbe3b..656ef3e17c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,7 @@ 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) # Maintainers: if you consider blanket disabling this for your users, please # consider the following points: @@ -511,15 +512,17 @@ else() message("OpenAL explicitly disabled, disabling OpenAL sound backend") endif() -include(FindLLVM OPTIONAL) -if (LLVM_FOUND) - add_definitions(-DHAS_LLVM=1) - set(HAS_LLVM 1) +if(ENABLE_LLVM) + include(FindLLVM OPTIONAL) + if (LLVM_FOUND) + add_definitions(-DHAS_LLVM=1) + set(HAS_LLVM 1) - include_directories(${LLVM_INCLUDE_DIRS}) - list(APPEND LIBS ${LLVM_LIBRARIES}) + include_directories(${LLVM_INCLUDE_DIRS}) + list(APPEND LIBS ${LLVM_LIBRARIES}) - message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}") + message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}") + endif() endif() set(USE_X11 0) From de485f3efcd6a28331184283e937e8ad6182006f Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sat, 3 Dec 2016 18:37:23 +0000 Subject: [PATCH 3/3] CMake: Add an option to disable bluez support. This removes bluetooth support. --- CMakeLists.txt | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 656ef3e17c..58af5915c0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,7 @@ 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 # consider the following points: @@ -476,14 +477,18 @@ else() message("ao explicitly disabled, disabling ao sound backend") endif() -check_lib(BLUEZ bluez bluez QUIET) -if(BLUEZ_FOUND) - add_definitions(-DHAVE_BLUEZ=1) - message("bluez found, enabling bluetooth support") +if(ENABLE_BLUEZ) + check_lib(BLUEZ bluez bluez QUIET) + if(BLUEZ_FOUND) + 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() - add_definitions(-DHAVE_BLUEZ=0) - message("bluez NOT found, disabling bluetooth support") -endif(BLUEZ_FOUND) + message("bluez explicitly disabled, disabling bluetooth support") +endif() if(ENABLE_PULSEAUDIO) check_lib(PULSEAUDIO libpulse pulse QUIET)