backend: make DRM and libinput backends optional

Co-authored-by: Simon Ser <contact@emersion.fr>
This commit is contained in:
ayaka 2021-03-26 23:28:37 +08:00 committed by Simon Zeni
parent 66c42f4fcb
commit 70fb21c35b
8 changed files with 69 additions and 17 deletions

View file

@ -10,17 +10,14 @@ x11_required = [
'xcb-xinput',
]
msg = []
if get_option('x11-backend').enabled()
msg += 'Install "@0@" or pass "-Dx11-backend=disabled" to disable it.'
endif
if not get_option('x11-backend').disabled()
msg += 'Required for X11 backend support.'
msg = ['Required for X11 backend support.']
if 'x11' in backends
msg += 'Install "@0@" or disable the X11 backend.'
endif
foreach lib : x11_required
dep = dependency(lib,
required: get_option('x11-backend'),
required: 'x11' in backends,
not_found_message: '\n'.join(msg).format(lib),
)
if not dep.found()