summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-07-20 02:54:03 +0200
committerGitHub <noreply@github.com>2021-07-20 02:54:03 +0200
commitffc78ce9c17554bc72f205d6ea55ef7bc3363b47 (patch)
treed117cb643addb8d3ffb363951d892fd07278e1c7 /src
parentMerge pull request #6651 from lat9nq/update-settings (diff)
parentsdl_impl, emu_window: Remove clang ignore (diff)
downloadyuzu-ffc78ce9c17554bc72f205d6ea55ef7bc3363b47.tar
yuzu-ffc78ce9c17554bc72f205d6ea55ef7bc3363b47.tar.gz
yuzu-ffc78ce9c17554bc72f205d6ea55ef7bc3363b47.tar.bz2
yuzu-ffc78ce9c17554bc72f205d6ea55ef7bc3363b47.tar.lz
yuzu-ffc78ce9c17554bc72f205d6ea55ef7bc3363b47.tar.xz
yuzu-ffc78ce9c17554bc72f205d6ea55ef7bc3363b47.tar.zst
yuzu-ffc78ce9c17554bc72f205d6ea55ef7bc3363b47.zip
Diffstat (limited to 'src')
-rw-r--r--src/input_common/sdl/sdl_impl.h8
-rw-r--r--src/yuzu_cmd/CMakeLists.txt5
-rw-r--r--src/yuzu_cmd/emu_window/emu_window_sdl2.cpp8
-rw-r--r--src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp8
-rw-r--r--src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp28
5 files changed, 25 insertions, 32 deletions
diff --git a/src/input_common/sdl/sdl_impl.h b/src/input_common/sdl/sdl_impl.h
index b77afcbd8..7a9ad6346 100644
--- a/src/input_common/sdl/sdl_impl.h
+++ b/src/input_common/sdl/sdl_impl.h
@@ -10,15 +10,7 @@
#include <thread>
#include <unordered_map>
-// Ignore -Wimplicit-fallthrough due to https://github.com/libsdl-org/SDL/issues/4307
-#ifdef __GNUC__
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
-#endif
#include <SDL.h>
-#ifdef __GNUC__
-#pragma GCC diagnostic pop
-#endif
#include "common/common_types.h"
#include "common/threadsafe_queue.h"
diff --git a/src/yuzu_cmd/CMakeLists.txt b/src/yuzu_cmd/CMakeLists.txt
index 4bf25727b..e55a19649 100644
--- a/src/yuzu_cmd/CMakeLists.txt
+++ b/src/yuzu_cmd/CMakeLists.txt
@@ -38,6 +38,11 @@ target_include_directories(yuzu-cmd PRIVATE ${RESOURCES_DIR})
target_include_directories(yuzu-cmd PRIVATE ../../externals/Vulkan-Headers/include)
+if (YUZU_USE_EXTERNAL_SDL2)
+ target_compile_definitions(yuzu-cmd PRIVATE -DYUZU_USE_EXTERNAL_SDL2)
+ target_include_directories(yuzu-cmd PRIVATE ${PROJECT_BINARY_DIR}/externals/SDL/include)
+endif()
+
if(UNIX AND NOT APPLE)
install(TARGETS yuzu-cmd RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
endif()
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp
index 06b20c975..896181f0b 100644
--- a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp
+++ b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp
@@ -2,15 +2,7 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
-// Ignore -Wimplicit-fallthrough due to https://github.com/libsdl-org/SDL/issues/4307
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wimplicit-fallthrough"
-#endif
#include <SDL.h>
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
#include "common/logging/log.h"
#include "common/scm_rev.h"
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp
index 837a44be7..eadb41790 100644
--- a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp
+++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp
@@ -7,15 +7,7 @@
#include <string>
#define SDL_MAIN_HANDLED
-// Ignore -Wimplicit-fallthrough due to https://github.com/libsdl-org/SDL/issues/4307
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wimplicit-fallthrough"
-#endif
#include <SDL.h>
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
#include <fmt/format.h>
#include <glad/glad.h>
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp
index 3401ad4b4..152e56db8 100644
--- a/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp
+++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp
@@ -15,16 +15,13 @@
#include "video_core/renderer_vulkan/renderer_vulkan.h"
#include "yuzu_cmd/emu_window/emu_window_sdl2_vk.h"
-// Include these late to avoid polluting everything with Xlib macros
-// Ignore -Wimplicit-fallthrough due to https://github.com/libsdl-org/SDL/issues/4307
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wimplicit-fallthrough"
+#ifdef YUZU_USE_EXTERNAL_SDL2
+// Include this before SDL.h to prevent the external from including a dummy
+#define USING_GENERATED_CONFIG_H
+#include <SDL_config.h>
#endif
+
#include <SDL.h>
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
#include <SDL_syswm.h>
EmuWindow_SDL2_VK::EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsystem)
@@ -51,6 +48,11 @@ EmuWindow_SDL2_VK::EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsyste
window_info.type = Core::Frontend::WindowSystemType::Windows;
window_info.render_surface = reinterpret_cast<void*>(wm.info.win.window);
break;
+#else
+ case SDL_SYSWM_TYPE::SDL_SYSWM_WINDOWS:
+ LOG_CRITICAL(Frontend, "Window manager subsystem Windows not compiled");
+ std::exit(EXIT_FAILURE);
+ break;
#endif
#ifdef SDL_VIDEO_DRIVER_X11
case SDL_SYSWM_TYPE::SDL_SYSWM_X11:
@@ -58,6 +60,11 @@ EmuWindow_SDL2_VK::EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsyste
window_info.display_connection = wm.info.x11.display;
window_info.render_surface = reinterpret_cast<void*>(wm.info.x11.window);
break;
+#else
+ case SDL_SYSWM_TYPE::SDL_SYSWM_X11:
+ LOG_CRITICAL(Frontend, "Window manager subsystem X11 not compiled");
+ std::exit(EXIT_FAILURE);
+ break;
#endif
#ifdef SDL_VIDEO_DRIVER_WAYLAND
case SDL_SYSWM_TYPE::SDL_SYSWM_WAYLAND:
@@ -65,6 +72,11 @@ EmuWindow_SDL2_VK::EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsyste
window_info.display_connection = wm.info.wl.display;
window_info.render_surface = wm.info.wl.surface;
break;
+#else
+ case SDL_SYSWM_TYPE::SDL_SYSWM_WAYLAND:
+ LOG_CRITICAL(Frontend, "Window manager subsystem Wayland not compiled");
+ std::exit(EXIT_FAILURE);
+ break;
#endif
default:
LOG_CRITICAL(Frontend, "Window manager subsystem not implemented");