mirror of
https://github.com/cemu-project/Cemu.git
synced 2024-11-22 17:19:18 +01:00
Make Bluez optional
This commit is contained in:
parent
d52405935f
commit
e17b9d6a3b
@ -98,6 +98,7 @@ endif()
|
||||
if (UNIX AND NOT APPLE)
|
||||
option(ENABLE_WAYLAND "Build with Wayland support" ON)
|
||||
option(ENABLE_FERAL_GAMEMODE "Enables Feral Interactive GameMode Support" ON)
|
||||
option(ENABLE_BLUEZ "Build with Bluez support" ON)
|
||||
endif()
|
||||
|
||||
option(ENABLE_OPENGL "Enables the OpenGL backend" ON)
|
||||
@ -178,7 +179,12 @@ if (UNIX AND NOT APPLE)
|
||||
add_compile_definitions(HAS_WAYLAND)
|
||||
endif()
|
||||
find_package(GTK3 REQUIRED)
|
||||
|
||||
if(ENABLE_BLUEZ)
|
||||
find_package(bluez REQUIRED)
|
||||
set(ENABLE_WIIMOTE ON)
|
||||
add_compile_definitions(HAS_BLUEZ)
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
|
@ -1,10 +1,11 @@
|
||||
#include "input/api/Wiimote/WiimoteControllerProvider.h"
|
||||
#include "input/api/Wiimote/NativeWiimoteController.h"
|
||||
#include "input/api/Wiimote/WiimoteMessages.h"
|
||||
#if HAS_HIDAPI
|
||||
|
||||
#ifdef HAS_HIDAPI
|
||||
#include "input/api/Wiimote/hidapi/HidapiWiimote.h"
|
||||
#endif
|
||||
#if BOOST_OS_LINUX
|
||||
#ifdef HAS_BLUEZ
|
||||
#include "input/api/Wiimote/l2cap/L2CapWiimote.h"
|
||||
#endif
|
||||
|
||||
@ -150,11 +151,11 @@ void WiimoteControllerProvider::connectionThread()
|
||||
while (m_running.load(std::memory_order_relaxed))
|
||||
{
|
||||
std::vector<WiimoteDevicePtr> devices;
|
||||
#if HAS_HIDAPI
|
||||
#ifdef HAS_HIDAPI
|
||||
const auto& hidDevices = HidapiWiimote::get_devices();
|
||||
std::ranges::move(hidDevices, std::back_inserter(devices));
|
||||
#endif
|
||||
#if BOOST_OS_LINUX
|
||||
#ifdef HAS_BLUEZ
|
||||
const auto& l2capDevices = L2CapWiimote::get_devices();
|
||||
std::ranges::move(l2capDevices, std::back_inserter(devices));
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user