summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2022-12-30 05:37:25 +0100
committerGitHub <noreply@github.com>2022-12-30 05:37:25 +0100
commitc3af6d83724ef4640d2544f09220309cd93c701b (patch)
treed36867fbeb9bcafd8d263e9ba1a6d31fd5f93dd6 /src
parentMerge pull request #9521 from Wollnashorn/global-only-multiplayer-settings (diff)
parentcmake: make Vulkan-Headers external the default (diff)
downloadyuzu-c3af6d83724ef4640d2544f09220309cd93c701b.tar
yuzu-c3af6d83724ef4640d2544f09220309cd93c701b.tar.gz
yuzu-c3af6d83724ef4640d2544f09220309cd93c701b.tar.bz2
yuzu-c3af6d83724ef4640d2544f09220309cd93c701b.tar.lz
yuzu-c3af6d83724ef4640d2544f09220309cd93c701b.tar.xz
yuzu-c3af6d83724ef4640d2544f09220309cd93c701b.tar.zst
yuzu-c3af6d83724ef4640d2544f09220309cd93c701b.zip
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt5
-rw-r--r--src/audio_core/CMakeLists.txt19
-rw-r--r--src/input_common/CMakeLists.txt15
-rw-r--r--src/input_common/main.cpp24
4 files changed, 49 insertions, 14 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 140415474..c7283e82c 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -161,7 +161,10 @@ add_subdirectory(video_core)
add_subdirectory(network)
add_subdirectory(input_common)
add_subdirectory(shader_recompiler)
-add_subdirectory(dedicated_room)
+
+if (YUZU_ROOM)
+ add_subdirectory(dedicated_room)
+endif()
if (YUZU_TESTS)
add_subdirectory(tests)
diff --git a/src/audio_core/CMakeLists.txt b/src/audio_core/CMakeLists.txt
index 420ba62e0..e7b595459 100644
--- a/src/audio_core/CMakeLists.txt
+++ b/src/audio_core/CMakeLists.txt
@@ -187,11 +187,7 @@ add_library(audio_core STATIC
renderer/voice/voice_info.cpp
renderer/voice/voice_info.h
renderer/voice/voice_state.h
- sink/cubeb_sink.cpp
- sink/cubeb_sink.h
sink/null_sink.h
- sink/sdl2_sink.cpp
- sink/sdl2_sink.h
sink/sink.h
sink/sink_details.cpp
sink/sink_details.h
@@ -222,11 +218,22 @@ if (ARCHITECTURE_x86_64 OR ARCHITECTURE_arm64)
target_link_libraries(audio_core PRIVATE dynarmic::dynarmic)
endif()
-if(ENABLE_CUBEB)
+if (ENABLE_CUBEB)
+ target_sources(audio_core PRIVATE
+ sink/cubeb_sink.cpp
+ sink/cubeb_sink.h
+ )
+
target_link_libraries(audio_core PRIVATE cubeb::cubeb)
target_compile_definitions(audio_core PRIVATE -DHAVE_CUBEB=1)
endif()
-if(ENABLE_SDL2)
+
+if (ENABLE_SDL2)
+ target_sources(audio_core PRIVATE
+ sink/sdl2_sink.cpp
+ sink/sdl2_sink.h
+ )
+
target_link_libraries(audio_core PRIVATE SDL2::SDL2)
target_compile_definitions(audio_core PRIVATE HAVE_SDL2)
endif()
diff --git a/src/input_common/CMakeLists.txt b/src/input_common/CMakeLists.txt
index f24c89b04..cef2c4d52 100644
--- a/src/input_common/CMakeLists.txt
+++ b/src/input_common/CMakeLists.txt
@@ -4,14 +4,10 @@
add_library(input_common STATIC
drivers/camera.cpp
drivers/camera.h
- drivers/gc_adapter.cpp
- drivers/gc_adapter.h
drivers/keyboard.cpp
drivers/keyboard.h
drivers/mouse.cpp
drivers/mouse.h
- drivers/sdl_driver.cpp
- drivers/sdl_driver.h
drivers/tas_input.cpp
drivers/tas_input.h
drivers/touch_screen.cpp
@@ -62,8 +58,17 @@ if (ENABLE_SDL2)
target_compile_definitions(input_common PRIVATE HAVE_SDL2)
endif()
+if (ENABLE_LIBUSB)
+ target_sources(input_common PRIVATE
+ drivers/gc_adapter.cpp
+ drivers/gc_adapter.h
+ )
+ target_link_libraries(input_common PRIVATE libusb::usb)
+ target_compile_definitions(input_common PRIVATE HAVE_LIBUSB)
+endif()
+
create_target_directory_groups(input_common)
-target_link_libraries(input_common PUBLIC core PRIVATE common Boost::boost libusb::usb)
+target_link_libraries(input_common PUBLIC core PRIVATE common Boost::boost)
if (YUZU_USE_PRECOMPILED_HEADERS)
target_precompile_headers(input_common PRIVATE precompiled_headers.h)
diff --git a/src/input_common/main.cpp b/src/input_common/main.cpp
index 86deb4c7c..4dc92f482 100644
--- a/src/input_common/main.cpp
+++ b/src/input_common/main.cpp
@@ -5,7 +5,6 @@
#include "common/input.h"
#include "common/param_package.h"
#include "input_common/drivers/camera.h"
-#include "input_common/drivers/gc_adapter.h"
#include "input_common/drivers/keyboard.h"
#include "input_common/drivers/mouse.h"
#include "input_common/drivers/tas_input.h"
@@ -19,6 +18,10 @@
#include "input_common/input_mapping.h"
#include "input_common/input_poller.h"
#include "input_common/main.h"
+
+#ifdef HAVE_LIBUSB
+#include "input_common/drivers/gc_adapter.h"
+#endif
#ifdef HAVE_SDL2
#include "input_common/drivers/sdl_driver.h"
#endif
@@ -45,7 +48,9 @@ struct InputSubsystem::Impl {
RegisterEngine("keyboard", keyboard);
RegisterEngine("mouse", mouse);
RegisterEngine("touch", touch_screen);
+#ifdef HAVE_LIBUSB
RegisterEngine("gcpad", gcadapter);
+#endif
RegisterEngine("cemuhookudp", udp_client);
RegisterEngine("tas", tas_input);
RegisterEngine("camera", camera);
@@ -72,7 +77,9 @@ struct InputSubsystem::Impl {
UnregisterEngine(keyboard);
UnregisterEngine(mouse);
UnregisterEngine(touch_screen);
+#ifdef HAVE_LIBUSB
UnregisterEngine(gcadapter);
+#endif
UnregisterEngine(udp_client);
UnregisterEngine(tas_input);
UnregisterEngine(camera);
@@ -95,8 +102,10 @@ struct InputSubsystem::Impl {
devices.insert(devices.end(), keyboard_devices.begin(), keyboard_devices.end());
auto mouse_devices = mouse->GetInputDevices();
devices.insert(devices.end(), mouse_devices.begin(), mouse_devices.end());
+#ifdef HAVE_LIBUSB
auto gcadapter_devices = gcadapter->GetInputDevices();
devices.insert(devices.end(), gcadapter_devices.begin(), gcadapter_devices.end());
+#endif
auto udp_devices = udp_client->GetInputDevices();
devices.insert(devices.end(), udp_devices.begin(), udp_devices.end());
#ifdef HAVE_SDL2
@@ -119,9 +128,11 @@ struct InputSubsystem::Impl {
if (engine == mouse->GetEngineName()) {
return mouse;
}
+#ifdef HAVE_LIBUSB
if (engine == gcadapter->GetEngineName()) {
return gcadapter;
}
+#endif
if (engine == udp_client->GetEngineName()) {
return udp_client;
}
@@ -194,9 +205,11 @@ struct InputSubsystem::Impl {
if (engine == mouse->GetEngineName()) {
return true;
}
+#ifdef HAVE_LIBUSB
if (engine == gcadapter->GetEngineName()) {
return true;
}
+#endif
if (engine == udp_client->GetEngineName()) {
return true;
}
@@ -217,7 +230,9 @@ struct InputSubsystem::Impl {
void BeginConfiguration() {
keyboard->BeginConfiguration();
mouse->BeginConfiguration();
+#ifdef HAVE_LIBUSB
gcadapter->BeginConfiguration();
+#endif
udp_client->BeginConfiguration();
#ifdef HAVE_SDL2
sdl->BeginConfiguration();
@@ -227,7 +242,9 @@ struct InputSubsystem::Impl {
void EndConfiguration() {
keyboard->EndConfiguration();
mouse->EndConfiguration();
+#ifdef HAVE_LIBUSB
gcadapter->EndConfiguration();
+#endif
udp_client->EndConfiguration();
#ifdef HAVE_SDL2
sdl->EndConfiguration();
@@ -248,7 +265,6 @@ struct InputSubsystem::Impl {
std::shared_ptr<Keyboard> keyboard;
std::shared_ptr<Mouse> mouse;
- std::shared_ptr<GCAdapter> gcadapter;
std::shared_ptr<TouchScreen> touch_screen;
std::shared_ptr<TasInput::Tas> tas_input;
std::shared_ptr<CemuhookUDP::UDPClient> udp_client;
@@ -256,6 +272,10 @@ struct InputSubsystem::Impl {
std::shared_ptr<VirtualAmiibo> virtual_amiibo;
std::shared_ptr<VirtualGamepad> virtual_gamepad;
+#ifdef HAVE_LIBUSB
+ std::shared_ptr<GCAdapter> gcadapter;
+#endif
+
#ifdef HAVE_SDL2
std::shared_ptr<SDLDriver> sdl;
#endif