mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-25 08:29:23 +00:00
meson.build: Check for libudev directly, instead of our flimsy os-speciffic guessing
Implement what was discussed in X11Libre#478 Use dependency() instead of cc.check_header(), as the former is the intended way to check for dependencies. cc.check_headers would turn udev on on systems where libudev.h is present, but libudev.pc isn't. Thos would do the wrong thing on systems where the admin wants to have that header for some reason, but doesn't want programs to use libudev. We also keep udev and udev_kms a tristate, so we try to do the right thing when the user doesn't explicitly pass values for udev and udev_kms. Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
This commit is contained in:
committed by
Enrico Weigelt
parent
19917e3e15
commit
4b6e2aadff
24
meson.build
24
meson.build
@@ -184,27 +184,13 @@ endif
|
||||
|
||||
udev_option = get_option('udev')
|
||||
udev_kms_option = get_option('udev_kms')
|
||||
if ['windows', 'darwin', 'netbsd', 'openbsd', 'sunos'].contains(host_machine.system())
|
||||
if udev_option == 'auto'
|
||||
udev_option = 'false'
|
||||
endif
|
||||
if udev_kms_option == 'auto'
|
||||
udev_kms_option = 'false'
|
||||
endif
|
||||
if udev_option == 'true' or udev_kms_option == 'true'
|
||||
message('WARNING: udev is not supported on your platform')
|
||||
endif
|
||||
else
|
||||
if udev_option == 'auto'
|
||||
udev_option = 'true'
|
||||
endif
|
||||
if udev_kms_option == 'auto'
|
||||
udev_kms_option = 'true'
|
||||
endif
|
||||
if not dependency('libudev', required: (udev_option == 'true' or udev_kms_option == 'true')).found()
|
||||
udev_option = 'false'
|
||||
udev_kms_option = 'false'
|
||||
endif
|
||||
|
||||
build_udev = (udev_option == 'true')
|
||||
build_udev_kms = (udev_kms_option == 'true')
|
||||
build_udev = (udev_option != 'false')
|
||||
build_udev_kms = (udev_kms_option != 'false')
|
||||
|
||||
if get_option('systemd_logind') == 'auto'
|
||||
build_systemd_logind = build_udev_kms and dbus_dep.found()
|
||||
|
||||
Reference in New Issue
Block a user