meson: make ‘backlight’ plugin compile time optional

This commit is contained in:
Daniel Eklöf 2022-12-13 16:47:48 +01:00
parent 4c1398f1a5
commit 881359183f
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
4 changed files with 20 additions and 3 deletions

View file

@ -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