From 1a8125557943127d8e4cc6003d2589dd38e17efe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 14 Dec 2022 10:02:13 +0100 Subject: [PATCH] =?UTF-8?q?meson:=20make=20=E2=80=98xwindow=E2=80=99=20plu?= =?UTF-8?q?gin=20compile=20time=20optional?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- meson.build | 2 ++ meson_options.txt | 2 ++ modules/meson.build | 8 ++++---- plugin.c | 10 ++++++---- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/meson.build b/meson.build index 874abf6..e2c332b 100644 --- a/meson.build +++ b/meson.build @@ -150,6 +150,7 @@ yambar = executable( plugin_script_enabled ? '-DPLUGIN_ENABLED_SCRIPT' : [], plugin_sway_xkb_enabled ? '-DPLUGIN_ENABLED_SWAY_XKB' : [], plugin_xkb_enabled ? '-DPLUGIN_ENABLED_XKB' : [], + plugin_xwindow_enabled ? '-DPLUGIN_ENABLED_XWINDOW' : [], ], build_rpath: '$ORIGIN/modules:$ORIGIN/decorations:$ORIGIN/particles', export_dynamic: true, @@ -206,6 +207,7 @@ summary( 'Script': plugin_script_enabled, 'Sway XKB keyboard': plugin_sway_xkb_enabled, 'XKB keyboard (for X11)': plugin_xkb_enabled, + 'XWindow': plugin_xwindow_enabled, }, section: 'Optional modules', bool_yn: true diff --git a/meson_options.txt b/meson_options.txt index faa64a4..46c0abb 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -42,3 +42,5 @@ option('plugin-sway-xkb', type: 'feature', value: 'auto', description: 'keyboard support for Sway') option('plugin-xkb', type: 'feature', value: 'auto', description: 'keyboard support for X11') +option('plugin-xwindow', type: 'feature', value: 'auto', + description: 'XWindow support') diff --git a/modules/meson.build b/modules/meson.build index a89fed0..f1c8f41 100644 --- a/modules/meson.build +++ b/modules/meson.build @@ -45,6 +45,8 @@ plugin_sway_xkb_enabled = json_sway_xkb.found() xcb_xkb = dependency('xcb-xkb', required: get_option('plugin-xkb')) plugin_xkb_enabled = backend_x11 and xcb_xkb.found() +plugin_xwindow_enabled = backend_x11 and get_option('plugin-xwindow').allowed() + # Module name -> (source-list, dep-list) mod_data = {} @@ -120,10 +122,8 @@ if plugin_xkb_enabled mod_data += {'xkb': [[], [xcb_stuff, xcb_xkb]]} endif -if backend_x11 - mod_data += { - 'xwindow': [[], [xcb_stuff]], - } +if plugin_xwindow_enabled + mod_data += {'xwindow': [[], [xcb_stuff]]} endif if backend_wayland diff --git a/plugin.c b/plugin.c index 5b4024a..b7fc913 100644 --- a/plugin.c +++ b/plugin.c @@ -87,8 +87,10 @@ EXTERN_MODULE(sway_xkb); #if defined(PLUGIN_ENABLED_XKB) EXTERN_MODULE(xkb); #endif -EXTERN_MODULE(river); +#if defined(PLUGIN_ENABLED_XWINDOW) EXTERN_MODULE(xwindow); +#endif +EXTERN_MODULE(river); EXTERN_PARTICLE(empty); EXTERN_PARTICLE(list); @@ -209,12 +211,12 @@ init(void) #if defined(PLUGIN_ENABLED_XKB) REGISTER_CORE_MODULE(xkb, xkb); #endif +#if defined(PLUGIN_ENABLED_XWINDOW) + REGISTER_CORE_MODULE(xwindow, xwindow); +#endif #if defined(HAVE_PLUGIN_river) REGISTER_CORE_MODULE(river, river); #endif -#if defined(HAVE_PLUGIN_xwindow) - REGISTER_CORE_MODULE(xwindow, xwindow); -#endif REGISTER_CORE_PARTICLE(empty, empty); REGISTER_CORE_PARTICLE(list, list);