From 0e98bf69f146eb72fe3a7c3b19a049b5786f0ca3 Mon Sep 17 00:00:00 2001 From: Petri Latvala Date: Thu, 21 Jun 2018 14:06:25 +0300 Subject: meson: Add options to control optional parts Distributions want explicit control over optional parts so they can state runtime dependencies before building. Let's restore the functionality autotools used to provide. Where possible, the selection is done by choosing whether to build a particular item and the option name is build_$item. Example: build_overlay. Where not possible, the option name is with_$item. Example: with_valgrind. Array options require a bump of required meson version to 0.44. Debian stable has meson 0.37 which is already too old, stable-backports has 0.45, CI uses 0.45. Mesa's meson requirement is 0.44.1, for a perspective. Note, the old hack for not building docs when cross-compiling is gone, as doc building can be explicitly controlled now. v2: glib not optional v3: bump meson version to 0.44 Signed-off-by: Petri Latvala Cc: Matt Turner Cc: Daniel Vetter Cc: Eric Anholt Cc: Arkadiusz Hiler Signed-off-by: Arkadiusz Hiler Reviewed-by: Daniel Vetter --- man/meson.build | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'man') diff --git a/man/meson.build b/man/meson.build index 49b0686a..fa01f9dd 100644 --- a/man/meson.build +++ b/man/meson.build @@ -22,10 +22,10 @@ defs_rst = configure_file(input : 'defs.rst.in', output : 'defs.rst', configuration : config) -rst2man = find_program('rst2man', required : false) +rst2man = find_program('rst2man', required : _man_required) rst2man_script = find_program('rst2man.sh') -if rst2man.found() +if _build_man and rst2man.found() foreach manpage : manpages custom_target(manpage + '.1', build_by_default : true, @@ -36,4 +36,10 @@ if rst2man.found() install : true, install_dir : join_paths(mandir, 'man1')) endforeach + build_info += 'Build man pages: Yes' +else + if _man_required + error('Cannot build man pages due to missing dependencies') + endif + build_info += 'Build man pages: No' endif -- cgit v1.2.3