From d9a6bdb85e1d1b7da42baa2c34958d66c3a056cf Mon Sep 17 00:00:00 2001 From: myrslint <206005528+myrslint@users.noreply.github.com> Date: Wed, 16 Apr 2025 03:23:40 +0000 Subject: [PATCH] Add basic scaffolding for including libsfdo in builds --- meson.build | 30 ++++++++++++++++++++++++++++++ meson_options.txt | 1 + 2 files changed, 31 insertions(+) diff --git a/meson.build b/meson.build index 9ce5723e7..d220f0d35 100644 --- a/meson.build +++ b/meson.build @@ -37,6 +37,34 @@ if is_freebsd add_project_arguments('-D_C11_SOURCE', language: 'c') endif +# Check for (currrently) optional libsfdo +sfdo_basedir = dependency( + 'libsfdo-basedir', + default_options: ['default_library=static', 'examples=false', 'tests=false'], + version: '>=0.1.3', + required: get_option('sfdo'), +) +sfdo_desktop = dependency( + 'libsfdo-desktop', + default_options: ['default_library=static', 'examples=false', 'tests=false'], + version: '>=0.1.3', + required: get_option('sfdo'), +) +sfdo_desktop_file = dependency( + 'libsfdo-desktop-file', + default_options: ['default_library=static', 'examples=false', 'tests=false'], + version: '>=0.1.3', + required: get_option('sfdo'), +) +sfdo_icon = dependency( + 'libsfdo-icon', + default_options: ['default_library=static', 'examples=false', 'tests=false'], + version: '>=0.1.3', + required: get_option('sfdo'), +) +have_libsfdo = sfdo_basedir.found() and sfdo_desktop.found() and sfdo_desktop_file.found() and sfdo_icon.found() + + # Execute the wlroots subproject, if any wlroots_version = ['>=0.19.0', '<0.20.0'] subproject( @@ -107,6 +135,7 @@ conf_data = configuration_data() conf_data.set10('HAVE_GDK_PIXBUF', gdk_pixbuf.found()) conf_data.set10('HAVE_LIBSYSTEMD', sdbus.found() and sdbus.name() == 'libsystemd') conf_data.set10('HAVE_LIBELOGIND', sdbus.found() and sdbus.name() == 'libelogind') +conf_data.set10('HAVE_LIBSFDO', have_libsfdo) conf_data.set10('HAVE_BASU', sdbus.found() and sdbus.name() == 'basu') conf_data.set10('HAVE_TRAY', have_tray) foreach sym : ['LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM', 'LIBINPUT_CONFIG_DRAG_LOCK_ENABLED_STICKY'] @@ -243,5 +272,6 @@ subdir('completions') summary({ 'gdk-pixbuf': gdk_pixbuf.found(), 'tray': have_tray, + 'libsfdo': have_libsfdo, 'man-pages': scdoc.found(), }, bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index 506ecc9a6..6f776bab7 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -8,3 +8,4 @@ option('tray', type: 'feature', value: 'auto', description: 'Enable support for option('gdk-pixbuf', type: 'feature', value: 'auto', description: 'Enable support for more image formats in swaybar tray') option('man-pages', type: 'feature', value: 'auto', description: 'Generate and install man pages') option('sd-bus-provider', type: 'combo', choices: ['auto', 'libsystemd', 'libelogind', 'basu'], value: 'auto', description: 'Provider of the sd-bus library') +option('sfdo', type: 'feature', value: 'auto', description: 'Enable libsfdo integration')