meson: make ‘foreign-toplevel’ plugin compile time optional

This commit is contained in:
Daniel Eklöf 2022-12-14 10:08:48 +01:00
parent 56b0047004
commit 9ef6d73663
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
4 changed files with 12 additions and 7 deletions

View file

@ -139,6 +139,7 @@ yambar = executable(
plugin_cpu_enabled ? '-DPLUGIN_ENABLED_CPU' : [],
plugin_disk_io_enabled ? '-DPLUGIN_ENABLED_DISK_IO' : [],
plugin_dwl_enabled ? '-DPLUGIN_ENABLED_DWL' : [],
plugin_foreign_toplevel_enabled ? '-DPLUGIN_ENABLED_FOREIGN_TOPLEVEL' : [],
plugin_mem_enabled ? '-DPLUGIN_ENABLED_MEM' : [],
plugin_mpd_enabled ? '-DPLUGIN_ENABLED_MPD' : [],
plugin_i3_enabled ? '-DPLUGIN_ENABLED_I3' : [],
@ -197,6 +198,7 @@ summary(
'CPU monitoring': plugin_cpu_enabled,
'Disk I/O monitoring': plugin_disk_io_enabled,
'DWL (dwm for Wayland)': plugin_dwl_enabled,
'Foreign toplevel (window tracking for Wayland)': plugin_foreign_toplevel_enabled,
'Memory monitoring': plugin_mem_enabled,
'Music Player Daemon (MPD)': plugin_mpd_enabled,
'i3+Sway': plugin_i3_enabled,
@ -209,7 +211,7 @@ summary(
'Script': plugin_script_enabled,
'Sway XKB keyboard': plugin_sway_xkb_enabled,
'XKB keyboard (for X11)': plugin_xkb_enabled,
'XWindow': plugin_xwindow_enabled,
'XWindow (window tracking for X11)': plugin_xwindow_enabled,
},
section: 'Optional modules',
bool_yn: true

View file

@ -20,6 +20,8 @@ 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-foreign-toplevel', type: 'feature', value: 'auto',
description: 'Foreign toplevel (window tracking for Wayland) support')
option('plugin-mem', type: 'feature', value: 'auto',
description: 'Memory monitoring support')
option('plugin-mpd', type: 'feature', value: 'auto',
@ -45,4 +47,4 @@ option('plugin-sway-xkb', type: 'feature', value: 'auto',
option('plugin-xkb', type: 'feature', value: 'auto',
description: 'keyboard support for X11')
option('plugin-xwindow', type: 'feature', value: 'auto',
description: 'XWindow support')
description: 'XWindow (window tracking for X11) support')

View file

@ -16,6 +16,7 @@ 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()
plugin_dwl_enabled = get_option('plugin-dwl').allowed()
plugin_foreign_toplevel_enabled = backend_wayland and get_option('plugin-foreign-toplevel').allowed()
plugin_mem_enabled = get_option('plugin-mem').allowed()
mpd = dependency('libmpdclient', required: get_option('plugin-mpd'))
@ -150,7 +151,7 @@ if plugin_river_enabled
mod_data += {'river': [[wl_proto_src + wl_proto_headers + river_proto_src + river_proto_headers], [dynlist, wayland_client]]}
endif
if backend_wayland
if plugin_foreign_toplevel_enabled
ftop_proto_headers = []
ftop_proto_src = []
@ -169,9 +170,7 @@ if backend_wayland
command: [wscanner_prog, 'private-code', '@INPUT@', '@OUTPUT@'])
endforeach
mod_data += {
'foreign-toplevel': [[wl_proto_src + wl_proto_headers + ftop_proto_headers + ftop_proto_src], [dynlist, wayland_client]],
}
mod_data += {'foreign-toplevel': [[wl_proto_src + wl_proto_headers + ftop_proto_headers + ftop_proto_src], [dynlist, wayland_client]]}
endif
foreach mod, data : mod_data

View file

@ -53,7 +53,9 @@ EXTERN_MODULE(disk_io);
#if defined(PLUGIN_ENABLED_DWL)
EXTERN_MODULE(dwl);
#endif
#if defined(PLUGIN_ENABLED_FOREIGN_TOPLEVEL)
EXTERN_MODULE(foreign_toplevel);
#endif
#if defined(PLUGIN_ENABLED_MEM)
EXTERN_MODULE(mem);
#endif
@ -177,7 +179,7 @@ init(void)
#if defined(PLUGIN_ENABLED_DWL)
REGISTER_CORE_MODULE(dwl, dwl);
#endif
#if defined(HAVE_PLUGIN_foreign_toplevel)
#if defined(PLUGIN_ENABLED_FOREIGN_TOPLEVEL)
REGISTER_CORE_MODULE(foreign-toplevel, foreign_toplevel);
#endif
#if defined(PLUGIN_ENABLED_MEM)