Issue #8604: Linux Input is enabled even though it is not Linux.

Fix the Linux Input test to correctly only depend on whether or not the
header is present. Having X11 target is not enough (e.g. it breaks the
build for NetBSD and probably on all BSDs).
This commit is contained in:
Jehan 2022-09-10 14:49:38 +02:00
parent 76bc349279
commit a78651aca4

View file

@ -852,15 +852,23 @@ endif
alsa = dependency('alsa', version: '>=1.0.0', required: get_option('alsa'))
conf.set('HAVE_ALSA', alsa.found())
# Linux Input
if get_option('linux-input').disabled()
have_linuxinput = false
elif get_option('linux-input').enabled() and not cc.has_header('linux/input.h')
error('linux/input.h header not found.')
else
have_linuxinput = x11_target
have_linuxinput = cc.has_header('linux/input.h',
required: get_option('linux-input'))
endif
if have_linuxinput
gudev = dependency('gudev-1.0', version: '>=167', required: get_option('gudev'))
else
gudev = no_dep
endif
conf.set('HAVE_LIBGUDEV', gudev.found())
# DirectX DirectInput
directx = no_dep
directx_sdk_path = get_option('directx-sdk-dir')
@ -881,9 +889,6 @@ if directx_sdk_path != '' and platform_windows
endif
conf.set('HAVE_DX_DINPUT', directx.found())
gudev = dependency('gudev-1.0', version: '>=167', required: get_option('gudev'))
conf.set('HAVE_LIBGUDEV', gudev.found())
################################################################################
# Email sending