From fdad47c994df77f4ecf7c60baa3193ccf3542145 Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Fri, 24 May 2019 08:28:29 +0300 Subject: man/build: Fix dependency handling build_man is a 'feature' option, which means that we get an opaque object, so comparing it to 'yes' is always false. It should have been 'if build_man.enabled()'. But going even further we can prune the whole check, as rst2man is defined as follows: rst2man = find_program('rst2man-3', 'rst2man', required : build_man) >From the patch overhauling those options: get_option() on a feature returns opaque object that can be passed as a 'required' argument of a dependency. Auto is equivalent to 'required : false', enabled is equivalent to 'required : true' and disabled introduces new behavior forcing the dependency to be considered not found. This would cause the build to fail if build_man is enabled (aka 'required') and rst2man is not found. So... if rst2man.found() # rst2man found # buildu buildu else # rst2man not found, but considered optional because # we haven't erred out on find_program if build_man.enabled() # cannot be, it's optional! error('...') endif endif We can get rid of the whole else block here. Cc: Antonio Argenziano Cc: Petri Latvala Signed-off-by: Arkadiusz Hiler Reviewed-by: Simon Ser --- man/meson.build | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'man') diff --git a/man/meson.build b/man/meson.build index 0f0a6dd4..2c1396af 100644 --- a/man/meson.build +++ b/man/meson.build @@ -38,10 +38,6 @@ if rst2man.found() install : true, install_dir : join_paths(mandir, 'man1')) endforeach - build_info += 'Build man pages: true' -else - if build_man == 'yes' - error('Cannot build man pages due to missing dependencies') - endif - build_info += 'Build man pages: false' endif + +build_info += 'Build man pages: @0@'.format(rst2man.found()) -- cgit v1.2.3