From d1ee3889cf8e8a9edc82e41d306155fb4c531c8f Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Thu, 5 Jun 2025 11:05:08 +0200 Subject: [PATCH] meson: Add libmount feature Let's reduce the dependencies required to build just libsystemd by making libmount optional. The meson disabler feature makes this quite trivial. --- meson.build | 4 +++- meson_options.txt | 2 ++ tools/oss-fuzz.sh | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index e062919daa8..78b22fff27d 100644 --- a/meson.build +++ b/meson.build @@ -1125,7 +1125,9 @@ else endif libmount = dependency('mount', - version : fuzzer_build ? '>= 0' : '>= 2.30') + version : fuzzer_build ? '>= 0' : '>= 2.30', + disabler : true, + required : get_option('libmount')) libfdisk = dependency('fdisk', version : '>= 2.32', diff --git a/meson_options.txt b/meson_options.txt index 8d62f5157ca..d8dec33ec42 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -470,6 +470,8 @@ option('dbus', type : 'feature', deprecated : { 'true' : 'enabled', 'false' : 'd description : 'libdbus support (for tests only)') option('libarchive', type : 'feature', description : 'libarchive support') +option('libmount', type : 'feature', + description : 'libmount support') option('bootloader', type : 'feature', deprecated : { 'true' : 'enabled', 'false' : 'disabled' }, description : 'sd-boot/stub and userspace tools') diff --git a/tools/oss-fuzz.sh b/tools/oss-fuzz.sh index 3cd5cec6703..6df95afcfe4 100755 --- a/tools/oss-fuzz.sh +++ b/tools/oss-fuzz.sh @@ -38,7 +38,7 @@ else # statically linking isn't viable for us for various reasons, we do a build with most features disabled # to link against as few libraries as possible. The libraries we do end up linking against happen (by # chance) to be installed in the oss-fuzz execution environment. - meson_args+=("-Doss-fuzz=true" "--auto-features=disabled" "-Dnspawn=enabled" "-Dresolve=true") + meson_args+=("-Doss-fuzz=true" "--auto-features=disabled" "-Dlibmount=enabled" "-Dnspawn=enabled" "-Dresolve=true") apt-get update apt-get install -y gperf m4 gettext python3-pip \ -- 2.47.3