wayland: Update xkbcommon to avoid using deprecated modifier names

xkbcommon 1.10.0 declared certain modifier names to be deprecated, and the current plan is to remove them in 1.12.0. Use the new recommended names and modifier mask retrieval function when building against version 1.10.0 and higher.
This commit is contained in:
Frank Praznik
2025-05-31 12:33:19 -04:00
parent b61586b492
commit c764e8864b
5 changed files with 36 additions and 0 deletions

View File

@@ -594,6 +594,18 @@ macro(CheckWayland)
sdl_link_dependency(wayland LIBS PkgConfig::PC_WAYLAND PKG_CONFIG_PREFIX PC_WAYLAND PKG_CONFIG_SPECS ${WAYLAND_PKG_CONFIG_SPEC})
endif()
# xkbcommon doesn't provide internal version defines, so generate them here.
if (PC_WAYLAND_xkbcommon_VERSION MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)")
set(SDL_XKBCOMMON_VERSION_MAJOR ${CMAKE_MATCH_1})
set(SDL_XKBCOMMON_VERSION_MINOR ${CMAKE_MATCH_2})
set(SDL_XKBCOMMON_VERSION_PATCH ${CMAKE_MATCH_3})
else()
message(WARNING "Failed to parse xkbcommon version; defaulting to lowest supported (0.5.0)")
set(SDL_XKBCOMMON_VERSION_MAJOR 0)
set(SDL_XKBCOMMON_VERSION_MINOR 5)
set(SDL_XKBCOMMON_VERSION_PATCH 0)
endif()
if(SDL_WAYLAND_LIBDECOR)
set(LibDecor_PKG_CONFIG_SPEC libdecor-0)
pkg_check_modules(PC_LIBDECOR IMPORTED_TARGET ${LibDecor_PKG_CONFIG_SPEC})