]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
meson: Add build-chcpu option
authorJordan Williams <jordan@jwillikers.com>
Mon, 22 Apr 2024 14:14:26 +0000 (09:14 -0500)
committerJordan Williams <jordan@jwillikers.com>
Wed, 24 Apr 2024 20:30:30 +0000 (15:30 -0500)
The cpu_set_t type does not exist on macOS.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
meson.build
meson_options.txt

index cddeb98372cc0cf10b24e05fdb823481a81a5765..0c29d7c6357233a94ca845cc07f5382f4563cf35 100644 (file)
@@ -1903,16 +1903,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',
index b2507d228ba589547cdbbf42f54224d50d4f967a..ed4001d44e3d220e156759025ade968b5c84528f 100644 (file)
@@ -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',