rsx: Make X11 optional on Linux

This makes it possible to build rpcs3 on a pure Wayland system, without
the Xlib installed.
This commit is contained in:
Emmanuel Gil Peyrot 2019-11-20 16:53:41 +01:00 committed by Ani
parent 6dd4003154
commit e30173a835
9 changed files with 74 additions and 17 deletions

View file

@ -26,8 +26,10 @@
#include <QGuiApplication>
#include <qpa/qplatformnativeinterface.h>
#endif
#ifdef HAVE_X11
#include <X11/Xlib.h>
#endif
#endif
constexpr auto qstr = QString::fromStdString;
@ -235,7 +237,11 @@ display_handle_t gs_frame::handle() const
else
{
#endif
#ifdef HAVE_X11
return std::make_pair(XOpenDisplay(0), static_cast<ulong>(this->winId()));
#else
fmt::throw_exception("Vulkan X11 support disabled at compile-time.");
#endif
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
}
#endif