diff --git a/util/meson.build b/util/meson.build index 4f34ab944..fc1a44253 100644 --- a/util/meson.build +++ b/util/meson.build @@ -15,6 +15,11 @@ hb_subset_cli_sources = [ 'helper-subset.hh', ] +# If found, invoke it on our four binaries to build man pages +# If not found, just skip this step +help2man = find_program('help2man', required: false) +help2man_command = [help2man, '--help-option=--help-all', '--no-info', '--output=' + '@OUTPUT@', '@INPUT@'] + util_deps = [freetype_dep, cairo_dep, cairo_ft_dep, glib_dep] if conf.get('HAVE_GLIB', 0) == 1 @@ -27,6 +32,17 @@ if conf.get('HAVE_GLIB', 0) == 1 install: true, ) meson.override_find_program('hb-view', hb_view) + if help2man.found() + target = hb_view.name() + '.1' + hb_view_manpage = custom_target(target, + input: hb_view, + output: target, + command: help2man_command, + depends: [hb_view], + install: true, + install_dir: get_option('mandir') / 'man1', + ) + endif endif hb_shape = executable('hb-shape', hb_shape_sources, @@ -56,6 +72,20 @@ if conf.get('HAVE_GLIB', 0) == 1 ) meson.override_find_program('hb-subset', hb_subset) + if help2man.found() + foreach binary: [hb_shape, hb_info, hb_subset] + target = binary.name() + '.1' + manpage = custom_target(target, + input: binary, + output: target, + command: help2man_command, + depends: [binary], + install: true, + install_dir: get_option('mandir') / 'man1', + ) + endforeach + endif + if get_option('experimental_api') test('test-hb-subset-parsing', executable('test-hb-subset-parsing', @@ -74,23 +104,4 @@ else # Disable tests that use this hb_shape = disabler() hb_subset = disabler() -endif - -# Build man pages -help2man = find_program('help2man', required: false) -# If found, invoke it on our four binaries to build man pages -# If not found, just skip this step -if help2man.found() - foreach binary: [hb_view, hb_shape, hb_info, hb_subset] - target = binary.name() + '.1' - manpage = custom_target(target, - input: binary, - output: target, - command: [help2man, '--help-option=--help-all', '--no-info', '--output=' + '@OUTPUT@', '@INPUT@'], - build_by_default: true, - install: true, - install_dir: get_option('mandir') / 'man1', - ) - endforeach -endif - +endif \ No newline at end of file