diff --git a/meson.build b/meson.build index e777f5e6dc..57a25411f1 100644 --- a/meson.build +++ b/meson.build @@ -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