mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-25 05:15:41 +02:00
meson: make ‘disk-io’ plugin compile time optional
This commit is contained in:
parent
b23365ccac
commit
659b282445
4 changed files with 13 additions and 1 deletions
|
@ -137,6 +137,7 @@ yambar = executable(
|
|||
plugin_battery_enabled ? '-DPLUGIN_ENABLED_BATTERY' : [],
|
||||
plugin_clock_enabled ? '-DPLUGIN_ENABLED_CLOCK' : [],
|
||||
plugin_cpu_enabled ? '-DPLUGIN_ENABLED_CPU' : [],
|
||||
plugin_disk_io_enabled ? '-DPLUGIN_ENABLED_DISK_IO' : [],
|
||||
plugin_dwl_enabled ? '-DPLUGIN_ENABLED_DWL' : [],
|
||||
plugin_mpd_enabled ? '-DPLUGIN_ENABLED_MPD' : [],
|
||||
plugin_pipewire_enabled ? '-DPLUGIN_ENABLED_PIPEWIRE' : [],
|
||||
|
@ -184,6 +185,7 @@ summary(
|
|||
'Battery': plugin_battery_enabled,
|
||||
'Clock': plugin_clock_enabled,
|
||||
'CPU': plugin_cpu_enabled,
|
||||
'Disk I/O': plugin_disk_io_enabled,
|
||||
'DWL (dwm for Wayland)': plugin_dwl_enabled,
|
||||
'Music Player Daemon (MPD)': plugin_mpd_enabled,
|
||||
'Pipewire': plugin_pipewire_enabled,
|
||||
|
|
|
@ -16,6 +16,8 @@ option('plugin-clock', type: 'feature', value: 'auto',
|
|||
description: 'Clock support')
|
||||
option('plugin-cpu', type: 'feature', value: 'auto',
|
||||
description: 'CPU support')
|
||||
option('plugin-disk-io', type: 'feature', value: 'auto',
|
||||
description: 'Disk I/O support')
|
||||
option('plugin-dwl', type: 'feature', value: 'auto',
|
||||
description: 'DWL (dwm for wayland) support')
|
||||
option('plugin-mpd', type: 'feature', value: 'auto',
|
||||
|
|
|
@ -18,6 +18,7 @@ plugin_battery_enabled = udev_battery.found()
|
|||
|
||||
plugin_clock_enabled = get_option('plugin-clock').allowed()
|
||||
plugin_cpu_enabled = get_option('plugin-cpu').allowed()
|
||||
plugin_disk_io_enabled = get_option('plugin-disk-io').allowed()
|
||||
|
||||
mpd = dependency('libmpdclient', required: get_option('plugin-mpd'))
|
||||
plugin_mpd_enabled = mpd.found()
|
||||
|
@ -32,7 +33,6 @@ plugin_dwl_enabled = get_option('plugin-dwl').allowed()
|
|||
|
||||
# Module name -> (source-list, dep-list)
|
||||
mod_data = {
|
||||
'disk-io': [[], [dynlist]],
|
||||
'mem': [[], []],
|
||||
'i3': [['i3-common.c', 'i3-common.h'], [dynlist, json]],
|
||||
'label': [[], []],
|
||||
|
@ -62,6 +62,10 @@ if plugin_cpu_enabled
|
|||
mod_data += {'cpu': [[], []]}
|
||||
endif
|
||||
|
||||
if plugin_disk_io_enabled
|
||||
mod_data += {'disk-io': [[], [dynlist]]}
|
||||
endif
|
||||
|
||||
if plugin_dwl_enabled
|
||||
mod_data += {'dwl': [[], [dynlist]]}
|
||||
endif
|
||||
|
|
4
plugin.c
4
plugin.c
|
@ -47,7 +47,9 @@ EXTERN_MODULE(clock);
|
|||
#if defined(PLUGIN_ENABLED_CPU)
|
||||
EXTERN_MODULE(cpu);
|
||||
#endif
|
||||
#if defined(PLUGIN_ENABLED_DISK_IO)
|
||||
EXTERN_MODULE(disk_io);
|
||||
#endif
|
||||
#if defined(PLUGIN_ENABLED_DWL)
|
||||
EXTERN_MODULE(dwl);
|
||||
#endif
|
||||
|
@ -149,7 +151,9 @@ init(void)
|
|||
#if defined(PLUGIN_ENABLED_CPU)
|
||||
REGISTER_CORE_MODULE(cpu, cpu);
|
||||
#endif
|
||||
#if defined(PLUGIN_ENABLED_DISK_IO)
|
||||
REGISTER_CORE_MODULE(disk-io, disk_io);
|
||||
#endif
|
||||
#if defined(PLUGIN_ENABLED_DWL)
|
||||
REGISTER_CORE_MODULE(dwl, dwl);
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue