From 5230a8c996eb513efff52005af01fbfbaf5e0145 Mon Sep 17 00:00:00 2001 From: Michael Maltese Date: Wed, 3 May 2017 15:15:10 -0700 Subject: [PATCH] CMake: only look for Bluez on Linux Stops CMake from saying "BlueZ NOT found, disabling bluetooth support" on other OSes. Windows, macOS, and Android support Bluetooth using other libraries. I'm not sure if non-Linux, non-Android Unices (like FreeBSD) need another message? --- CMakeLists.txt | 1 - Source/Core/Core/CMakeLists.txt | 23 +++++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f4e2c302be00..9cc0393a7298 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,6 @@ option(ENABLE_ALSA "Enables ALSA 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: diff --git a/Source/Core/Core/CMakeLists.txt b/Source/Core/Core/CMakeLists.txt index a68a87d73151..cdff1480ad1d 100644 --- a/Source/Core/Core/CMakeLists.txt +++ b/Source/Core/Core/CMakeLists.txt @@ -326,18 +326,21 @@ elseif(UNIX) endif() # Bluez doesn't support all the communication modes on FreeBSD, so only using it on Linux -if(ENABLE_BLUEZ AND CMAKE_SYSTEM_NAME MATCHES "Linux") - find_package(BlueZ) - if(BLUEZ_FOUND) - message(STATUS "BlueZ found, enabling bluetooth support") - set(SRCS ${SRCS} HW/WiimoteReal/IOLinux.cpp) - set(LIBS ${LIBS} BlueZ::BlueZ) - add_definitions(-DHAVE_BLUEZ=1) +if(CMAKE_SYSTEM_NAME MATCHES "Linux") + option(ENABLE_BLUEZ "Enables bluetooth support" ON) + if(ENABLE_BLUEZ) + find_package(BlueZ) + if(BLUEZ_FOUND) + message(STATUS "BlueZ found, enabling bluetooth support") + set(SRCS ${SRCS} HW/WiimoteReal/IOLinux.cpp) + set(LIBS ${LIBS} BlueZ::BlueZ) + add_definitions(-DHAVE_BLUEZ=1) + else() + message(STATUS "BlueZ NOT found, disabling bluetooth support") + endif() else() - message(STATUS "BlueZ NOT found, disabling bluetooth support") + message(STATUS "BlueZ explicitly disabled, disabling bluetooth support") endif() -else() - message(STATUS "BlueZ explicitly disabled, disabling bluetooth support") endif() if(HIDAPI_FOUND)