From cd8fd8a1e23b39f6cb069a4829cf2ecc497c8e1c Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Mon, 22 Apr 2024 08:46:55 -0500 Subject: [PATCH] meson: Add build-blkpr option Signed-off-by: Jordan Williams --- meson.build | 18 ++++++++++-------- meson_options.txt | 2 ++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/meson.build b/meson.build index 5b4f59b8c..fb895a8d9 100644 --- a/meson.build +++ b/meson.build @@ -1610,14 +1610,16 @@ if cc.has_header('linux/blkzoned.h') bashcompletions += ['blkzone'] endif -if cc.has_header('linux/pr.h') - exe = executable( - 'blkpr', - blkpr_sources, - include_directories : includes, - link_with : [lib_common], - install_dir : sbindir, - install : true) +opt = get_option('build-blkpr').require(cc.has_header('linux/pr.h')).allowed() +exe = executable( + 'blkpr', + blkpr_sources, + include_directories : includes, + link_with : [lib_common], + install_dir : sbindir, + install : opt, + build_by_default : opt) +if opt and not is_disabler(exe) exes += exe manadocs += ['sys-utils/blkpr.8.adoc'] endif diff --git a/meson_options.txt b/meson_options.txt index ca76530a9..2de75784f 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -141,6 +141,8 @@ option('build-fstrim', type : 'feature', description : 'build fstrim') option('build-dmesg', type : 'feature', description : 'build dmesg') +option('build-blkpr', type : 'feature', + description : 'build blkpr') option('build-kill', type : 'feature', description : 'build kill') option('build-last', type : 'feature', -- 2.47.3