forked from external/yambar
meson: make ‘backlight’ plugin compile time optional
This commit is contained in:
parent
4c1398f1a5
commit
881359183f
4 changed files with 20 additions and 3 deletions
|
@ -133,6 +133,7 @@ yambar = executable(
|
|||
decorations + particles + modules,
|
||||
c_args: [
|
||||
plugin_alsa_enabled ? '-DPLUGIN_ENABLED_ALSA' : [],
|
||||
plugin_backlight_enabled ? '-DPLUGIN_ENABLED_BACKLIGHT' : [],
|
||||
plugin_dwl_enabled ? '-DPLUGIN_ENABLED_DWL' : [],
|
||||
plugin_mpd_enabled ? '-DPLUGIN_ENABLED_MPD' : [],
|
||||
plugin_pipewire_enabled ? '-DPLUGIN_ENABLED_PIPEWIRE' : [],
|
||||
|
@ -176,6 +177,7 @@ summary(
|
|||
summary(
|
||||
{
|
||||
'ALSA': plugin_alsa_enabled,
|
||||
'Backlight': plugin_backlight_enabled,
|
||||
'DWL (dwm for Wayland)': plugin_dwl_enabled,
|
||||
'Music Player Daemon (MPD)': plugin_mpd_enabled,
|
||||
'Pipewire': plugin_pipewire_enabled,
|
||||
|
|
|
@ -6,7 +6,12 @@ option(
|
|||
'core-plugins-as-shared-libraries', type: 'boolean', value: false,
|
||||
description: 'Compiles modules, particles and decorations as shared libraries, which are loaded on-demand')
|
||||
|
||||
option('plugin-alsa', type: 'feature', value: 'auto', description: 'ALSA')
|
||||
option('plugin-alsa', type: 'feature', value: 'auto',
|
||||
description: 'ALSA support')
|
||||
option('plugin-backlight', type: 'feature', value: 'auto',
|
||||
description: 'Backlight support')
|
||||
option('plugin-battery', type: 'feature', value: 'auto',
|
||||
description: 'Battery support')
|
||||
option('plugin-dwl', type: 'feature', value: 'auto',
|
||||
description: 'DWL (dwm for wayland) support')
|
||||
option('plugin-mpd', type: 'feature', value: 'auto',
|
||||
|
|
|
@ -2,7 +2,7 @@ module_sdk = declare_dependency(dependencies: [pixman, threads, tllist, fcft])
|
|||
|
||||
modules = []
|
||||
|
||||
udev = dependency('libudev')
|
||||
udev = dependency('udev')
|
||||
json = dependency('json-c')
|
||||
xcb_xkb = dependency('xcb-xkb', required: get_option('backend-x11'))
|
||||
|
||||
|
@ -10,6 +10,9 @@ xcb_xkb = dependency('xcb-xkb', required: get_option('backend-x11'))
|
|||
alsa = dependency('alsa', required: get_option('plugin-alsa'))
|
||||
plugin_alsa_enabled = alsa.found()
|
||||
|
||||
udev_backlight = dependency('libudev', required: get_option('plugin-backlight'))
|
||||
plugin_backlight_enabled = udev_backlight.found()
|
||||
|
||||
mpd = dependency('libmpdclient', required: get_option('plugin-mpd'))
|
||||
plugin_mpd_enabled = mpd.found()
|
||||
|
||||
|
@ -23,7 +26,6 @@ plugin_dwl_enabled = get_option('plugin-dwl').allowed()
|
|||
|
||||
# Module name -> (source-list, dep-list)
|
||||
mod_data = {
|
||||
'backlight': [[], [m, udev]],
|
||||
'battery': [[], [udev]],
|
||||
'clock': [[], []],
|
||||
'cpu': [[], []],
|
||||
|
@ -41,6 +43,10 @@ if plugin_alsa_enabled
|
|||
mod_data += {'alsa': [[], [m, alsa]]}
|
||||
endif
|
||||
|
||||
if plugin_backlight_enabled
|
||||
mod_data += {'backlight': [[], [m, udev_backlight]]}
|
||||
endif
|
||||
|
||||
if plugin_dwl_enabled
|
||||
mod_data += {'dwl': [[], [dynlist]]}
|
||||
endif
|
||||
|
|
4
plugin.c
4
plugin.c
|
@ -35,7 +35,9 @@
|
|||
#if defined(PLUGIN_ENABLED_ALSA)
|
||||
EXTERN_MODULE(alsa);
|
||||
#endif
|
||||
#if defined(PLUGIN_ENABLED_BACKLIGHT)
|
||||
EXTERN_MODULE(backlight);
|
||||
#endif
|
||||
EXTERN_MODULE(battery);
|
||||
EXTERN_MODULE(clock);
|
||||
EXTERN_MODULE(disk_io);
|
||||
|
@ -129,7 +131,9 @@ init(void)
|
|||
#if defined(PLUGIN_ENABLED_ALSA)
|
||||
REGISTER_CORE_MODULE(alsa, alsa);
|
||||
#endif
|
||||
#if defined(PLUGIN_ENABLED_BACKLIGHT)
|
||||
REGISTER_CORE_MODULE(backlight, backlight);
|
||||
#endif
|
||||
REGISTER_CORE_MODULE(battery, battery);
|
||||
REGISTER_CORE_MODULE(clock, clock);
|
||||
REGISTER_CORE_MODULE(disk-io, disk_io);
|
||||
|
|
Loading…
Add table
Reference in a new issue