build: check if libinput supports high-res scroll

Add a project argument (LIBINPUT_HAS_SCROLL_VALUE120) to allow
building against old versions of libinput or, where high-resolution
scroll is available, support it.
This commit is contained in:
José Expósito 2021-09-20 19:46:45 +02:00
parent d0b8c111fd
commit bc3b39bde3

View file

@ -27,3 +27,14 @@ wlr_files += files(
features += { 'libinput-backend': true }
wlr_deps += libinput
# Check whether libinput supports high-resolution scroll or not
libinput_supports_scroll_value120 = cc.has_function(
'libinput_event_pointer_get_scroll_value_v120',
dependencies: libinput,
)
add_project_arguments(
'-DLIBINPUT_HAS_SCROLL_VALUE120=@0@'.format(libinput_supports_scroll_value120.to_int()),
language: 'c',
)