diff options
author | Arkadiusz Hiler <arkadiusz.hiler@intel.com> | 2019-05-24 08:28:29 +0300 |
---|---|---|
committer | Arkadiusz Hiler <arkadiusz.hiler@intel.com> | 2019-05-24 14:57:26 +0300 |
commit | fdad47c994df77f4ecf7c60baa3193ccf3542145 (patch) | |
tree | 7a1b544fbd82b714539df06a06c6461e1c79bbb5 /man/meson.build | |
parent | 996b4346b6a7f2bd0919817648a4f7a382e59757 (diff) |
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 <antonio.argenziano@intel.com>
Cc: Petri Latvala <petri.latvala@intel.com>
Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Reviewed-by: Simon Ser <simon.ser@intel.com>
Diffstat (limited to 'man/meson.build')
-rw-r--r-- | man/meson.build | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/man/meson.build b/man/meson.build index 0f0a6dd41..2c1396af2 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()) |