From fa907a8810d9a0e7049a01828e2dd0d53567cf0a Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Mon, 22 Apr 2024 09:03:52 -0500 Subject: [PATCH] meson: Add build-rtcwake option Signed-off-by: Jordan Williams --- meson.build | 12 ++++++++---- meson_options.txt | 2 ++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index aa4ed8b81..90c71b49e 100644 --- a/meson.build +++ b/meson.build @@ -1651,16 +1651,20 @@ if opt and not is_disabler(exe) bashcompletions += ['ldattach'] endif +opt = get_option('build-rtcwake').require(cc.has_header('linux/rtc.h')).allowed() exe = executable( 'rtcwake', rtcwake_sources, include_directories : includes, link_with : [lib_common], install_dir : usrsbin_exec_dir, - install : true) -exes += exe -manadocs += ['sys-utils/rtcwake.8.adoc'] -bashcompletions += ['rtcwake'] + install : opt, + build_by_default : opt) +if opt and not is_disabler(exe) + exes += exe + manadocs += ['sys-utils/rtcwake.8.adoc'] + bashcompletions += ['rtcwake'] +endif exe = executable( 'setarch', diff --git a/meson_options.txt b/meson_options.txt index 8a11cd8e1..42469fa67 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -151,6 +151,8 @@ option('build-blkpr', type : 'feature', description : 'build blkpr') option('build-ldattach', type : 'feature', description : 'build ldattach') +option('build-rtcwake', type : 'feature', + description : 'build rtcwake') option('build-kill', type : 'feature', description : 'build kill') option('build-last', type : 'feature', -- 2.47.3