meson: enable_x11 -> backend_x11, enable_wayland -> backend_wayland

This commit is contained in:
Daniel Eklöf 2019-05-06 21:45:01 +02:00
parent 8135313396
commit 121b2f1575
3 changed files with 9 additions and 11 deletions

View file

@ -1,14 +1,12 @@
bar_backends = [] bar_backends = []
# TODO: X11 if backend_x11
if enable_x11
bar_x11 = declare_dependency(sources: ['xcb.c', 'xcb.h'], bar_x11 = declare_dependency(sources: ['xcb.c', 'xcb.h'],
dependencies: [xcb_stuff, cairo, cairo_ft]) dependencies: [xcb_stuff, cairo, cairo_ft])
bar_backends += [bar_x11] bar_backends += [bar_x11]
endif endif
# TODO: conditional Wayland if backend_wayland
if enable_wayland
wayland_protocols = dependency('wayland-protocols') wayland_protocols = dependency('wayland-protocols')
wayland_protocols_datadir = wayland_protocols.get_pkgconfig_variable('pkgdatadir') wayland_protocols_datadir = wayland_protocols.get_pkgconfig_variable('pkgdatadir')

View file

@ -30,10 +30,10 @@ if xcb_aux.found() and xcb_cursor.found() and xcb_event.found() and \
xcb_ewmh.found() and xcb_randr.found() and xcb_render.found() and \ xcb_ewmh.found() and xcb_randr.found() and xcb_render.found() and \
cairo_xcb.found() cairo_xcb.found()
enable_x11 = true backend_x11 = true
add_project_arguments('-DENABLE_X11', language: 'c') add_project_arguments('-DENABLE_X11', language: 'c')
else else
enable_x11 = false backend_x11 = false
endif endif
wayland_client = dependency('wayland-client', required: get_option('backend-wayland')) wayland_client = dependency('wayland-client', required: get_option('backend-wayland'))
@ -41,13 +41,13 @@ wayland_cursor = dependency('wayland-cursor', required: get_option('backend-wayl
wlroots = dependency('wlroots', required: get_option('backend-wayland')) wlroots = dependency('wlroots', required: get_option('backend-wayland'))
if wayland_client.found() and wayland_cursor.found() and wlroots.found() if wayland_client.found() and wayland_cursor.found() and wlroots.found()
enable_wayland = true backend_wayland = true
add_project_arguments('-DENABLE_WAYLAND', language: 'c') add_project_arguments('-DENABLE_WAYLAND', language: 'c')
else else
enable_wayland = false backend_wayland = false
endif endif
if enable_x11 if backend_x11
xcb_stuff_lib = static_library( xcb_stuff_lib = static_library(
'xcb-stuff', 'xcb.c', 'xcb.h', 'xcb-stuff', 'xcb.c', 'xcb.h',
dependencies: [xcb_aux, xcb_cursor, xcb_event, xcb_ewmh, xcb_randr, dependencies: [xcb_aux, xcb_cursor, xcb_event, xcb_ewmh, xcb_randr,

View file

@ -21,7 +21,7 @@ deps = {
'removables': [[], [dynlist, udev]], 'removables': [[], [dynlist, udev]],
} }
if enable_x11 if backend_x11
deps_x11_only = { deps_x11_only = {
'xkb': [[], [xcb_stuff, xcb_xkb]], 'xkb': [[], [xcb_stuff, xcb_xkb]],
'xwindow': [[], [xcb_stuff]], 'xwindow': [[], [xcb_stuff]],
@ -46,7 +46,7 @@ foreach mod, data : deps
endif endif
endforeach endforeach
if enable_x11 if backend_x11
foreach mod, data : deps_x11_only foreach mod, data : deps_x11_only
sources = data[0] sources = data[0]
dep = data[1] dep = data[1]