diff --git a/project/lib/custom/sdl/include/SDL_build_config.h b/project/lib/custom/sdl/include/SDL_build_config.h
index 38d9bd9317..91a209d7fc 100644
--- a/project/lib/custom/sdl/include/SDL_build_config.h
+++ b/project/lib/custom/sdl/include/SDL_build_config.h
@@ -550,6 +550,18 @@
# define SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM "libgbm.so.1" /**< Dynamic libgbm loading */
/** @} */
+/**
+ * @name Wayland Video Driver
+ * @brief Wayland Window System video driver with extensions.
+ * @{
+ */
+# define SDL_VIDEO_DRIVER_WAYLAND 1 /**< Wayland video driver */
+# define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC "libwayland-client.so.0" /**< Wayland client library */
+# define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR "libwayland-cursor.so.0" /**< Wayland cursor library */
+# define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL "libwayland-egl.so.1" /**< Wayland EGL library */
+# define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR "libdecor-0.so.0" /**< Wayland client-side decorations library */
+# define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON "libxkbcommon.so.0" /**< Wayland keymap library */
+
/**
* @name X11 Video Driver
* @brief X Window System video driver with extensions.
diff --git a/project/lib/sdl-files.xml b/project/lib/sdl-files.xml
index 9a6bb938c2..418449e9e1 100644
--- a/project/lib/sdl-files.xml
+++ b/project/lib/sdl-files.xml
@@ -533,6 +533,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tools/platforms/LinuxPlatform.hx b/tools/platforms/LinuxPlatform.hx
index 916048178f..a2d3b91562 100644
--- a/tools/platforms/LinuxPlatform.hx
+++ b/tools/platforms/LinuxPlatform.hx
@@ -465,8 +465,38 @@ class LinuxPlatform extends PlatformTarget
}
}
+ /**
+ * Generates the Wayland Protocols into the project obj folder before rebuild.
+ */
+ private function generateWaylandProtocols():Void
+ {
+ Log.println("Generating Wayland Protocols");
+ var outputDir = project.config.get("project.rebuild.path") + "/obj/generated/wayland";
+ var sdlPath = project.config.get("project.rebuild.path") + "/lib/sdl/wayland-protocols";
+
+ if (!FileSystem.exists(outputDir)) FileSystem.createDirectory(outputDir);
+
+ if (FileSystem.exists(sdlPath))
+ {
+ var xmls:Array = FileSystem.readDirectory(sdlPath);
+ for (xml in xmls)
+ {
+ if (!StringTools.endsWith(xml, ".xml")) continue;
+
+ var name = xml.substring(0, xml.lastIndexOf("."));
+ var xmlPath = '$sdlPath/$xml';
+
+ Log.println(' - obj/generated/wayland/$xml');
+ System.runCommand("", "wayland-scanner", ["client-header", xmlPath, '$outputDir/$name-client-protocol.h']);
+ System.runCommand("", "wayland-scanner", ["private-code", xmlPath, '$outputDir/$name-client-protocol.c']);
+ }
+ }
+ }
+
public override function rebuild():Void
{
+ generateWaylandProtocols();
+
var commands = [];
if (System.hostArchitecture == ARM64 )