forked from external/yambar
meson: make ‘sway-xkb’ plugin compile time optional
This commit is contained in:
parent
0cf0d64970
commit
b6450446a8
4 changed files with 22 additions and 10 deletions
|
@ -148,6 +148,7 @@ yambar = executable(
|
|||
plugin_pulse_enabled ? '-DPLUGIN_ENABLED_PULSE' : [],
|
||||
plugin_removables_enabled ? '-DPLUGIN_ENABLED_REMOVABLES' : [],
|
||||
plugin_script_enabled ? '-DPLUGIN_ENABLED_SCRIPT' : [],
|
||||
plugin_sway_xkb_enabled ? '-DPLUGIN_ENABLED_SWAY_XKB' : [],
|
||||
],
|
||||
build_rpath: '$ORIGIN/modules:$ORIGIN/decorations:$ORIGIN/particles',
|
||||
export_dynamic: true,
|
||||
|
@ -202,6 +203,7 @@ summary(
|
|||
'PulseAudio': plugin_pulse_enabled,
|
||||
'Removables monitoring': plugin_removables_enabled,
|
||||
'Script': plugin_script_enabled,
|
||||
'Sway XKB keyboard': plugin_sway_xkb_enabled,
|
||||
},
|
||||
section: 'Optional modules',
|
||||
bool_yn: true
|
||||
|
|
|
@ -30,11 +30,13 @@ option('plugin-label', type: 'feature', value: 'auto',
|
|||
description: 'Label support')
|
||||
option('plugin-network', type: 'feature', value: 'auto',
|
||||
description: 'Network monitoring support')
|
||||
option('plugin-removables', type: 'feature', value: 'auto',
|
||||
description: 'Removables (USB sticks, CD-ROM etc) monitoring support')
|
||||
option('plugin-script', type: 'feature', value: 'auto',
|
||||
description: 'Script support')
|
||||
option('plugin-pipewire', type: 'feature', value: 'auto',
|
||||
description: 'Pipewire support')
|
||||
option('plugin-pulse', type: 'feature', value: 'auto',
|
||||
description: 'PulseAudio support')
|
||||
option('plugin-removables', type: 'feature', value: 'auto',
|
||||
description: 'Removables (USB sticks, CD-ROM etc) monitoring support')
|
||||
option('plugin-script', type: 'feature', value: 'auto',
|
||||
description: 'Script support')
|
||||
option('plugin-sway-xkb', type: 'feature', value: 'auto',
|
||||
description: 'keyboard support for Sway')
|
||||
|
|
|
@ -2,7 +2,6 @@ module_sdk = declare_dependency(dependencies: [pixman, threads, tllist, fcft])
|
|||
|
||||
modules = []
|
||||
|
||||
json = dependency('json-c')
|
||||
xcb_xkb = dependency('xcb-xkb', required: get_option('backend-x11'))
|
||||
|
||||
# Optional deps
|
||||
|
@ -42,10 +41,11 @@ plugin_removables_enabled = udev_removables.found()
|
|||
|
||||
plugin_script_enabled = get_option('plugin-script').allowed()
|
||||
|
||||
json_sway_xkb = dependency('json-c', required: get_option('plugin-sway-xkb'))
|
||||
plugin_sway_xkb_enabled = json_sway_xkb.found()
|
||||
|
||||
# Module name -> (source-list, dep-list)
|
||||
mod_data = {
|
||||
'sway-xkb': [['i3-common.c', 'i3-common.h'], [dynlist, json]],
|
||||
}
|
||||
mod_data = {}
|
||||
|
||||
if plugin_alsa_enabled
|
||||
mod_data += {'alsa': [[], [m, alsa]]}
|
||||
|
@ -111,6 +111,10 @@ if plugin_script_enabled
|
|||
mod_data += {'script': [[], []]}
|
||||
endif
|
||||
|
||||
if plugin_sway_xkb_enabled
|
||||
mod_data += {'sway-xkb': [['i3-common.c', 'i3-common.h'], [dynlist, json_sway_xkb]]}
|
||||
endif
|
||||
|
||||
if backend_x11
|
||||
mod_data += {
|
||||
'xkb': [[], [xcb_stuff, xcb_xkb]],
|
||||
|
|
8
plugin.c
8
plugin.c
|
@ -81,8 +81,10 @@ EXTERN_MODULE(removables);
|
|||
#if defined(PLUGIN_ENABLED_SCRIPT)
|
||||
EXTERN_MODULE(script);
|
||||
#endif
|
||||
EXTERN_MODULE(river);
|
||||
#if defined(PLUGIN_ENABLED_SWAY_XKB)
|
||||
EXTERN_MODULE(sway_xkb);
|
||||
#endif
|
||||
EXTERN_MODULE(river);
|
||||
EXTERN_MODULE(xkb);
|
||||
EXTERN_MODULE(xwindow);
|
||||
|
||||
|
@ -199,10 +201,12 @@ init(void)
|
|||
#if defined(PLUGIN_ENABLED_SCRIPT)
|
||||
REGISTER_CORE_MODULE(script, script);
|
||||
#endif
|
||||
#if defined(PLUGIN_ENABLED_SWAY_XKB)
|
||||
REGISTER_CORE_MODULE(sway-xkb, sway_xkb);
|
||||
#endif
|
||||
#if defined(HAVE_PLUGIN_river)
|
||||
REGISTER_CORE_MODULE(river, river);
|
||||
#endif
|
||||
REGISTER_CORE_MODULE(sway-xkb, sway_xkb);
|
||||
#if defined(HAVE_PLUGIN_xkb)
|
||||
REGISTER_CORE_MODULE(xkb, xkb);
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue