From de485f3efcd6a28331184283e937e8ad6182006f Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sat, 3 Dec 2016 18:37:23 +0000 Subject: [PATCH] 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)