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 + -- ============================================== -- 加载构建目标 -- ==============================================