From: Jordan Williams Date: Mon, 22 Apr 2024 14:14:26 +0000 (-0500) Subject: meson: Add build-chcpu option X-Git-Tag: v2.40.1-rc1~9^2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=70c0742e7e0b8499fce0668816abad35a7cc0f16;p=thirdparty%2Futil-linux.git meson: Add build-chcpu option The cpu_set_t type does not exist on macOS. Signed-off-by: Jordan Williams (cherry picked from commit a2c940f44b2a54deedfc21cc7fd91625dcbacf1a) --- diff --git a/meson.build b/meson.build index 0e4e82b4f..95c71eb7a 100644 --- a/meson.build +++ b/meson.build @@ -1892,16 +1892,20 @@ if not is_disabler(exe) bashcompletions += ['lscpu'] endif +opt = get_option('build-chcpu').require(have_cpu_set_t).allowed() exe = executable( 'chcpu', chcpu_sources, include_directories : includes, link_with : [lib_common], install_dir : sbindir, - install : true) -exes += exe -manadocs += ['sys-utils/chcpu.8.adoc'] -bashcompletions += ['chcpu'] + install : opt, + build_by_default : opt) +if opt and not is_disabler(exe) + exes += exe + manadocs += ['sys-utils/chcpu.8.adoc'] + bashcompletions += ['chcpu'] +endif exe = executable( 'wdctl', diff --git a/meson_options.txt b/meson_options.txt index 28c0da806..b60e46a00 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -57,6 +57,8 @@ option('build-swapon', type : 'feature', description : 'build swapon') option('build-swapoff', type : 'feature', description : 'build swapoff') +option('build-chcpu', type : 'feature', + description : 'build chcpu') option('build-losetup', type : 'feature', description : 'build losetup') option('build-zramctl', type : 'feature',