mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-06-13 14:32:57 -04:00
backend/session: make udev dependency optional
udev is now optional at build-time but will fail at runtime because we don't have an alternative implementation yet.
This commit is contained in:
parent
e8b81b3d4a
commit
905ebaa89a
5 changed files with 31 additions and 10 deletions
|
|
@ -1,16 +1,21 @@
|
|||
msg = ['Required for libinput backend support.']
|
||||
if 'libinput' in backends
|
||||
msg += 'Install "libinput" or disable the libinput backend.'
|
||||
msg += 'Install "@0@" or disable the libinput backend.'
|
||||
endif
|
||||
|
||||
libinput = dependency(
|
||||
'libinput',
|
||||
version: '>=1.19.0',
|
||||
required: 'libinput' in backends,
|
||||
not_found_message: '\n'.join(msg),
|
||||
not_found_message: '\n'.join(msg).format('libinput'),
|
||||
)
|
||||
udev = dependency(
|
||||
'libudev',
|
||||
required: 'libinput' in backends,
|
||||
not_found_message: '\n'.join(msg).format('libudev'),
|
||||
)
|
||||
|
||||
if not (libinput.found() and features['session'])
|
||||
if not (libinput.found() and udev.found() and features['session'])
|
||||
subdir_done()
|
||||
endif
|
||||
|
||||
|
|
|
|||
|
|
@ -1,17 +1,22 @@
|
|||
msg = 'Required for session support.'
|
||||
udev = dependency('libudev', required: session_required, not_found_message: msg)
|
||||
libseat = dependency(
|
||||
'libseat',
|
||||
version: '>=0.2.0',
|
||||
fallback: 'seatd',
|
||||
default_options: ['server=disabled', 'man-pages=disabled', 'examples=disabled'],
|
||||
required: session_required,
|
||||
not_found_message: msg,
|
||||
not_found_message: 'Required for session support.',
|
||||
)
|
||||
if not (udev.found() and libseat.found())
|
||||
if not libseat.found()
|
||||
subdir_done()
|
||||
endif
|
||||
|
||||
wlr_files += files('session.c', 'udev.c')
|
||||
wlr_deps += [udev, libseat]
|
||||
wlr_files += files('session.c')
|
||||
wlr_deps += [libseat]
|
||||
features += { 'session': true }
|
||||
|
||||
udev = dependency('libudev', required: get_option('udev'))
|
||||
if udev.found()
|
||||
wlr_files += files('udev.c')
|
||||
wlr_deps += [udev]
|
||||
internal_features += { 'udev': true }
|
||||
endif
|
||||
|
|
|
|||
|
|
@ -15,9 +15,13 @@
|
|||
#include <xf86drm.h>
|
||||
#include <xf86drmMode.h>
|
||||
#include "backend/session/session.h"
|
||||
#include "backend/session/udev.h"
|
||||
#include "config.h"
|
||||
#include "util/time.h"
|
||||
|
||||
#if HAVE_UDEV
|
||||
#include "backend/session/udev.h"
|
||||
#endif
|
||||
|
||||
#define WAIT_GPU_TIMEOUT 10000 // ms
|
||||
|
||||
struct wlr_device *session_find_device_by_devid(struct wlr_session *session, dev_t devid) {
|
||||
|
|
@ -188,11 +192,16 @@ struct wlr_session *wlr_session_create(struct wl_event_loop *event_loop) {
|
|||
goto error_open;
|
||||
}
|
||||
|
||||
#if HAVE_UDEV
|
||||
session->device_manager = wlr_udev_device_manager_create(session);
|
||||
if (session->device_manager == NULL) {
|
||||
wlr_log(WLR_ERROR, "Failed to create udev device manager");
|
||||
goto error_session;
|
||||
}
|
||||
#else
|
||||
wlr_log(WLR_ERROR, "Session requires udev");
|
||||
goto error_session;
|
||||
#endif
|
||||
|
||||
session->event_loop_destroy.notify = handle_event_loop_destroy;
|
||||
wl_event_loop_add_destroy_listener(event_loop, &session->event_loop_destroy);
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ internal_features = {
|
|||
'xcb-errors': false,
|
||||
'egl': false,
|
||||
'libliftoff': false,
|
||||
'udev': false,
|
||||
}
|
||||
internal_config = configuration_data()
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ option('backends', type: 'array', choices: ['auto', 'drm', 'libinput', 'x11'], v
|
|||
option('allocators', type: 'array', choices: ['auto', 'gbm', 'udmabuf'], value: ['auto'],
|
||||
description: 'Select built-in allocators')
|
||||
option('session', type: 'feature', value: 'auto', description: 'Enable session support')
|
||||
option('udev', type: 'feature', value: 'auto', description: 'Use udev for device management')
|
||||
option('tests', type: 'boolean', value: true, description: 'Build tests and benchmarks')
|
||||
option('color-management', type: 'feature', value: 'auto', description: 'Enable support for color management')
|
||||
option('libliftoff', type: 'feature', value: 'auto', description: 'Enable support for libliftoff')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue