From 174385e40f7c49fa6c65e65694c0b321575db0a6 Mon Sep 17 00:00:00 2001 From: lenheart <947330670@qq.com> Date: Sun, 15 Feb 2026 14:55:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BA=86=20linux=20=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=20Sdl2=E8=BF=9C=E7=A8=8B=E5=8C=85=E6=97=B6=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0wayland=20=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xmake.lua | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/xmake.lua b/xmake.lua index 11db356..5d3a8ce 100644 --- a/xmake.lua +++ b/xmake.lua @@ -85,9 +85,21 @@ end if target_plat ~= "switch" then add_requires("glm") add_requires("nlohmann_json") - add_requires("libsdl2") + local sdl2_configs = { + configs = { + wayland = false + } + } + if target_plat == "linux" then + local is_wayland = os.getenv("XDG_SESSION_TYPE") == "wayland" + if is_wayland then + sdl2_configs.configs.wayland = true + end + end + add_requires("libsdl2", sdl2_configs) end + -- ============================================== -- 加载构建目标 -- ==============================================