From 3e6d539e6e283927639c02792c968848f6c7dc71 Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Mon, 22 Apr 2024 09:42:25 -0500 Subject: [PATCH] meson: Add build-blockdev option Only build blockdev on Linux. The BLKROSET macro is used in blockdev.c from blkdev.h. The blkdev.h header only defines this macro when it is missing on Linux. Add blockdev to the list of executables, which appears to have been omitted previously. Signed-off-by: Jordan Williams --- meson.build | 11 ++++++++--- meson_options.txt | 2 ++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 0c29d7c63..8a7324832 100644 --- a/meson.build +++ b/meson.build @@ -2314,15 +2314,20 @@ if opt and not is_disabler(exe) bashcompletions += ['fdformat'] endif +opt = get_option('build-blockdev').require(LINUX).allowed() exe = executable( 'blockdev', blockdev_sources, include_directories : includes, link_with : [lib_common], install_dir : sbindir, - install : true) -manadocs += ['disk-utils/blockdev.8.adoc'] -bashcompletions += ['blockdev'] + install : opt, + build_by_default : opt) +if opt and not is_disabler(exe) + exes += exe + manadocs += ['disk-utils/blockdev.8.adoc'] + bashcompletions += ['blockdev'] +endif opt = not get_option('build-fdisks').disabled() if opt and not have_dirfd and not have_ddfd diff --git a/meson_options.txt b/meson_options.txt index ed4001d44..39ff026ce 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -99,6 +99,8 @@ option('build-minix', type : 'feature', description : 'build fsck.minix, mkfs.minix') option('build-fdformat', type : 'feature', value : 'disabled', description : 'build fdformat') +option('build-blockdev', type : 'feature', + description : 'build blockdev') option('build-hwclock', type : 'feature', description : 'build hwclock') option('build-lslogins', type : 'feature', -- 2.47.3