meson: make ‘xwindow’ plugin compile time optional

This commit is contained in:
Daniel Eklöf 2022-12-14 10:02:13 +01:00
parent a14d38b0cb
commit 1a81255579
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
4 changed files with 14 additions and 8 deletions

View file

@ -150,6 +150,7 @@ yambar = executable(
plugin_script_enabled ? '-DPLUGIN_ENABLED_SCRIPT' : [],
plugin_sway_xkb_enabled ? '-DPLUGIN_ENABLED_SWAY_XKB' : [],
plugin_xkb_enabled ? '-DPLUGIN_ENABLED_XKB' : [],
plugin_xwindow_enabled ? '-DPLUGIN_ENABLED_XWINDOW' : [],
],
build_rpath: '$ORIGIN/modules:$ORIGIN/decorations:$ORIGIN/particles',
export_dynamic: true,
@ -206,6 +207,7 @@ summary(
'Script': plugin_script_enabled,
'Sway XKB keyboard': plugin_sway_xkb_enabled,
'XKB keyboard (for X11)': plugin_xkb_enabled,
'XWindow': plugin_xwindow_enabled,
},
section: 'Optional modules',
bool_yn: true

View file

@ -42,3 +42,5 @@ option('plugin-sway-xkb', type: 'feature', value: 'auto',
description: 'keyboard support for Sway')
option('plugin-xkb', type: 'feature', value: 'auto',
description: 'keyboard support for X11')
option('plugin-xwindow', type: 'feature', value: 'auto',
description: 'XWindow support')

View file

@ -45,6 +45,8 @@ plugin_sway_xkb_enabled = json_sway_xkb.found()
xcb_xkb = dependency('xcb-xkb', required: get_option('plugin-xkb'))
plugin_xkb_enabled = backend_x11 and xcb_xkb.found()
plugin_xwindow_enabled = backend_x11 and get_option('plugin-xwindow').allowed()
# Module name -> (source-list, dep-list)
mod_data = {}
@ -120,10 +122,8 @@ if plugin_xkb_enabled
mod_data += {'xkb': [[], [xcb_stuff, xcb_xkb]]}
endif
if backend_x11
mod_data += {
'xwindow': [[], [xcb_stuff]],
}
if plugin_xwindow_enabled
mod_data += {'xwindow': [[], [xcb_stuff]]}
endif
if backend_wayland

View file

@ -87,8 +87,10 @@ EXTERN_MODULE(sway_xkb);
#if defined(PLUGIN_ENABLED_XKB)
EXTERN_MODULE(xkb);
#endif
EXTERN_MODULE(river);
#if defined(PLUGIN_ENABLED_XWINDOW)
EXTERN_MODULE(xwindow);
#endif
EXTERN_MODULE(river);
EXTERN_PARTICLE(empty);
EXTERN_PARTICLE(list);
@ -209,12 +211,12 @@ init(void)
#if defined(PLUGIN_ENABLED_XKB)
REGISTER_CORE_MODULE(xkb, xkb);
#endif
#if defined(PLUGIN_ENABLED_XWINDOW)
REGISTER_CORE_MODULE(xwindow, xwindow);
#endif
#if defined(HAVE_PLUGIN_river)
REGISTER_CORE_MODULE(river, river);
#endif
#if defined(HAVE_PLUGIN_xwindow)
REGISTER_CORE_MODULE(xwindow, xwindow);
#endif
REGISTER_CORE_PARTICLE(empty, empty);
REGISTER_CORE_PARTICLE(list, list);