mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-19 19:25:41 +02:00
meson: make ‘label’ plugin compile time optional
This commit is contained in:
parent
f54f583be1
commit
8d5e8b5f20
4 changed files with 16 additions and 3 deletions
|
@ -142,6 +142,7 @@ yambar = executable(
|
|||
plugin_mem_enabled ? '-DPLUGIN_ENABLED_MEM' : [],
|
||||
plugin_mpd_enabled ? '-DPLUGIN_ENABLED_MPD' : [],
|
||||
plugin_i3_enabled ? '-DPLUGIN_ENABLED_I3' : [],
|
||||
plugin_label_enabled ? '-DPLUGIN_ENABLED_LABEL' : [],
|
||||
plugin_pipewire_enabled ? '-DPLUGIN_ENABLED_PIPEWIRE' : [],
|
||||
plugin_pulse_enabled ? '-DPLUGIN_ENABLED_PULSE' : [],
|
||||
],
|
||||
|
@ -192,6 +193,7 @@ summary(
|
|||
'Memory monitoring': plugin_mem_enabled,
|
||||
'Music Player Daemon (MPD)': plugin_mpd_enabled,
|
||||
'i3+Sway': plugin_i3_enabled,
|
||||
'Label': plugin_label_enabled,
|
||||
'Pipewire': plugin_pipewire_enabled,
|
||||
'PulseAudio': plugin_pulse_enabled,
|
||||
},
|
||||
|
|
|
@ -26,6 +26,8 @@ option('plugin-mpd', type: 'feature', value: 'auto',
|
|||
description: 'Music Player Daemon (MPD) support')
|
||||
option('plugin-i3', type: 'feature', value: 'auto',
|
||||
description: 'i3+Sway support')
|
||||
option('plugin-label', type: 'feature', value: 'auto',
|
||||
description: 'Label support')
|
||||
option('plugin-pipewire', type: 'feature', value: 'auto',
|
||||
description: 'Pipewire support')
|
||||
option('plugin-pulse', type: 'feature', value: 'auto',
|
||||
|
|
|
@ -27,6 +27,8 @@ plugin_mpd_enabled = mpd.found()
|
|||
json_i3 = dependency('json-c', required: get_option('plugin-i3'))
|
||||
plugin_i3_enabled = json_i3.found()
|
||||
|
||||
plugin_label_enabled = get_option('plugin-label').allowed()
|
||||
|
||||
pipewire = dependency('libpipewire-0.3', required: get_option('plugin-pipewire'))
|
||||
plugin_pipewire_enabled = pipewire.found()
|
||||
|
||||
|
@ -37,7 +39,6 @@ plugin_dwl_enabled = get_option('plugin-dwl').allowed()
|
|||
|
||||
# Module name -> (source-list, dep-list)
|
||||
mod_data = {
|
||||
'label': [[], []],
|
||||
'network': [[], []],
|
||||
'removables': [[], [dynlist, udev]],
|
||||
'script': [[], []],
|
||||
|
@ -84,6 +85,10 @@ if plugin_i3_enabled
|
|||
mod_data += {'i3': [['i3-common.c', 'i3-common.h'], [dynlist, json_i3]]}
|
||||
endif
|
||||
|
||||
if plugin_label_enabled
|
||||
mod_data += {'label': [[], []]}
|
||||
endif
|
||||
|
||||
if plugin_pipewire_enabled
|
||||
mod_data += {'pipewire': [[], [pipewire, dynlist, json]]}
|
||||
endif
|
||||
|
|
8
plugin.c
8
plugin.c
|
@ -54,7 +54,6 @@ EXTERN_MODULE(disk_io);
|
|||
EXTERN_MODULE(dwl);
|
||||
#endif
|
||||
EXTERN_MODULE(foreign_toplevel);
|
||||
EXTERN_MODULE(label);
|
||||
#if defined(PLUGIN_ENABLED_MEM)
|
||||
EXTERN_MODULE(mem);
|
||||
#endif
|
||||
|
@ -64,6 +63,9 @@ EXTERN_MODULE(mpd);
|
|||
#if defined(PLUGIN_ENABLED_I3)
|
||||
EXTERN_MODULE(i3);
|
||||
#endif
|
||||
#if defined(PLUGIN_ENABLED_LABEL)
|
||||
EXTERN_MODULE(label);
|
||||
#endif
|
||||
EXTERN_MODULE(network);
|
||||
#if defined(PLUGIN_ENABLED_PULSE)
|
||||
EXTERN_MODULE(pulse);
|
||||
|
@ -164,7 +166,6 @@ init(void)
|
|||
#if defined(HAVE_PLUGIN_foreign_toplevel)
|
||||
REGISTER_CORE_MODULE(foreign-toplevel, foreign_toplevel);
|
||||
#endif
|
||||
REGISTER_CORE_MODULE(label, label);
|
||||
#if defined(PLUGIN_ENABLED_MEM)
|
||||
REGISTER_CORE_MODULE(mem, mem);
|
||||
#endif
|
||||
|
@ -173,6 +174,9 @@ init(void)
|
|||
#endif
|
||||
#if defined(PLUGIN_ENABLED_I3)
|
||||
REGISTER_CORE_MODULE(i3, i3);
|
||||
#endif
|
||||
#if defined(PLUGIN_ENABLED_LABEL)
|
||||
REGISTER_CORE_MODULE(label, label);
|
||||
#endif
|
||||
REGISTER_CORE_MODULE(network, network);
|
||||
#if defined(PLUGIN_ENABLED_PULSE)
|
||||
|
|
Loading…
Add table
Reference in a new issue