forked from external/yambar
meson: make ‘network’ plugin compile time optional
This commit is contained in:
parent
8d5e8b5f20
commit
b901ac50ee
4 changed files with 13 additions and 1 deletions
|
@ -143,6 +143,7 @@ yambar = executable(
|
||||||
plugin_mpd_enabled ? '-DPLUGIN_ENABLED_MPD' : [],
|
plugin_mpd_enabled ? '-DPLUGIN_ENABLED_MPD' : [],
|
||||||
plugin_i3_enabled ? '-DPLUGIN_ENABLED_I3' : [],
|
plugin_i3_enabled ? '-DPLUGIN_ENABLED_I3' : [],
|
||||||
plugin_label_enabled ? '-DPLUGIN_ENABLED_LABEL' : [],
|
plugin_label_enabled ? '-DPLUGIN_ENABLED_LABEL' : [],
|
||||||
|
plugin_network_enabled ? '-DPLUGIN_ENABLED_NETWORK' : [],
|
||||||
plugin_pipewire_enabled ? '-DPLUGIN_ENABLED_PIPEWIRE' : [],
|
plugin_pipewire_enabled ? '-DPLUGIN_ENABLED_PIPEWIRE' : [],
|
||||||
plugin_pulse_enabled ? '-DPLUGIN_ENABLED_PULSE' : [],
|
plugin_pulse_enabled ? '-DPLUGIN_ENABLED_PULSE' : [],
|
||||||
],
|
],
|
||||||
|
@ -194,6 +195,7 @@ summary(
|
||||||
'Music Player Daemon (MPD)': plugin_mpd_enabled,
|
'Music Player Daemon (MPD)': plugin_mpd_enabled,
|
||||||
'i3+Sway': plugin_i3_enabled,
|
'i3+Sway': plugin_i3_enabled,
|
||||||
'Label': plugin_label_enabled,
|
'Label': plugin_label_enabled,
|
||||||
|
'Network monitoring': plugin_network_enabled,
|
||||||
'Pipewire': plugin_pipewire_enabled,
|
'Pipewire': plugin_pipewire_enabled,
|
||||||
'PulseAudio': plugin_pulse_enabled,
|
'PulseAudio': plugin_pulse_enabled,
|
||||||
},
|
},
|
||||||
|
|
|
@ -28,6 +28,8 @@ option('plugin-i3', type: 'feature', value: 'auto',
|
||||||
description: 'i3+Sway support')
|
description: 'i3+Sway support')
|
||||||
option('plugin-label', type: 'feature', value: 'auto',
|
option('plugin-label', type: 'feature', value: 'auto',
|
||||||
description: 'Label support')
|
description: 'Label support')
|
||||||
|
option('plugin-network', type: 'feature', value: 'auto',
|
||||||
|
description: 'Network monitoring support')
|
||||||
option('plugin-pipewire', type: 'feature', value: 'auto',
|
option('plugin-pipewire', type: 'feature', value: 'auto',
|
||||||
description: 'Pipewire support')
|
description: 'Pipewire support')
|
||||||
option('plugin-pulse', type: 'feature', value: 'auto',
|
option('plugin-pulse', type: 'feature', value: 'auto',
|
||||||
|
|
|
@ -28,6 +28,7 @@ json_i3 = dependency('json-c', required: get_option('plugin-i3'))
|
||||||
plugin_i3_enabled = json_i3.found()
|
plugin_i3_enabled = json_i3.found()
|
||||||
|
|
||||||
plugin_label_enabled = get_option('plugin-label').allowed()
|
plugin_label_enabled = get_option('plugin-label').allowed()
|
||||||
|
plugin_network_enabled = get_option('plugin-network').allowed()
|
||||||
|
|
||||||
pipewire = dependency('libpipewire-0.3', required: get_option('plugin-pipewire'))
|
pipewire = dependency('libpipewire-0.3', required: get_option('plugin-pipewire'))
|
||||||
plugin_pipewire_enabled = pipewire.found()
|
plugin_pipewire_enabled = pipewire.found()
|
||||||
|
@ -39,7 +40,6 @@ plugin_dwl_enabled = get_option('plugin-dwl').allowed()
|
||||||
|
|
||||||
# Module name -> (source-list, dep-list)
|
# Module name -> (source-list, dep-list)
|
||||||
mod_data = {
|
mod_data = {
|
||||||
'network': [[], []],
|
|
||||||
'removables': [[], [dynlist, udev]],
|
'removables': [[], [dynlist, udev]],
|
||||||
'script': [[], []],
|
'script': [[], []],
|
||||||
'sway-xkb': [['i3-common.c', 'i3-common.h'], [dynlist, json]],
|
'sway-xkb': [['i3-common.c', 'i3-common.h'], [dynlist, json]],
|
||||||
|
@ -89,6 +89,10 @@ if plugin_label_enabled
|
||||||
mod_data += {'label': [[], []]}
|
mod_data += {'label': [[], []]}
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if plugin_network_enabled
|
||||||
|
mod_data += {'network': [[], []]}
|
||||||
|
endif
|
||||||
|
|
||||||
if plugin_pipewire_enabled
|
if plugin_pipewire_enabled
|
||||||
mod_data += {'pipewire': [[], [pipewire, dynlist, json]]}
|
mod_data += {'pipewire': [[], [pipewire, dynlist, json]]}
|
||||||
endif
|
endif
|
||||||
|
|
4
plugin.c
4
plugin.c
|
@ -66,7 +66,9 @@ EXTERN_MODULE(i3);
|
||||||
#if defined(PLUGIN_ENABLED_LABEL)
|
#if defined(PLUGIN_ENABLED_LABEL)
|
||||||
EXTERN_MODULE(label);
|
EXTERN_MODULE(label);
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(PLUGIN_ENABLED_NETWORK)
|
||||||
EXTERN_MODULE(network);
|
EXTERN_MODULE(network);
|
||||||
|
#endif
|
||||||
#if defined(PLUGIN_ENABLED_PULSE)
|
#if defined(PLUGIN_ENABLED_PULSE)
|
||||||
EXTERN_MODULE(pulse);
|
EXTERN_MODULE(pulse);
|
||||||
#endif
|
#endif
|
||||||
|
@ -178,7 +180,9 @@ init(void)
|
||||||
#if defined(PLUGIN_ENABLED_LABEL)
|
#if defined(PLUGIN_ENABLED_LABEL)
|
||||||
REGISTER_CORE_MODULE(label, label);
|
REGISTER_CORE_MODULE(label, label);
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(PLUGIN_ENABLED_NETWORK)
|
||||||
REGISTER_CORE_MODULE(network, network);
|
REGISTER_CORE_MODULE(network, network);
|
||||||
|
#endif
|
||||||
#if defined(PLUGIN_ENABLED_PULSE)
|
#if defined(PLUGIN_ENABLED_PULSE)
|
||||||
REGISTER_CORE_MODULE(pulse, pulse);
|
REGISTER_CORE_MODULE(pulse, pulse);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue