summaryrefslogtreecommitdiff
path: root/src/yuzu_cmd
diff options
context:
space:
mode:
authorlat9nq <22451773+lat9nq@users.noreply.github.com>2021-07-15 21:02:00 -0400
committerlat9nq <22451773+lat9nq@users.noreply.github.com>2021-07-16 15:43:02 -0400
commitd3748cad73f5a4bc11e6cd0ad178a8828676e45e (patch)
tree1c5dd1275315a12f2c49129bb8db4ceb75cee8f1 /src/yuzu_cmd
parent3cd3230295a4752c57df1364bc14b17ffdcde762 (diff)
emu_window_sdl2_vk: Use the generated SDL config
On Linux, due to the way we include SDL2 as a submodule, it makes it difficult for us to specify which SDL_config.h we intended to include. Before, CMake would default to the dummy one included with SDL and ignore the generated one. This tells CMake to use the generated one. In addition, we define USING_GENERATED_CONFIG_H to throw an error in case the dummy config is used by accident. Fixes Vulkan not working on Linux yuzu-cmd.
Diffstat (limited to 'src/yuzu_cmd')
-rw-r--r--src/yuzu_cmd/CMakeLists.txt5
-rw-r--r--src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp6
2 files changed, 11 insertions, 0 deletions
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_vk.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp
index 3401ad4b4..b6049b032 100644
--- a/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp
+++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp
@@ -15,6 +15,12 @@
#include "video_core/renderer_vulkan/renderer_vulkan.h"
#include "yuzu_cmd/emu_window/emu_window_sdl2_vk.h"
+#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 these late to avoid polluting everything with Xlib macros
// Ignore -Wimplicit-fallthrough due to https://github.com/libsdl-org/SDL/issues/4307
#ifdef __clang__