diff --git a/meson.build b/meson.build index 80e7035..1be8fdc 100644 --- a/meson.build +++ b/meson.build @@ -237,25 +237,27 @@ executable( c_args: fuzz_compile_args, ) -pandoc = find_program('pandoc') -mandir1 = join_paths(get_option('mandir'), 'man1') -mandir5 = join_paths(get_option('mandir'), 'man5') - -cagebreak_man = custom_target('cagebreak_man', - output : 'cagebreak.1', - input : 'man/cagebreak.1.md', - command : [pandoc, '-i', '@INPUT@', '-o', '@OUTPUT@', '-f', 'markdown-smart', '-t', 'man', '-s'], - install: true, - install_dir: mandir1 - ) +if get_option('man-pages') + pandoc = find_program('pandoc') + mandir1 = join_paths(get_option('mandir'), 'man1') + mandir5 = join_paths(get_option('mandir'), 'man5') + + cagebreak_man = custom_target('cagebreak_man', + output : 'cagebreak.1', + input : 'man/cagebreak.1.md', + command : [pandoc, '-i', '@INPUT@', '-o', '@OUTPUT@', '-f', 'markdown-smart', '-t', 'man', '-s'], + install: true, + install_dir: mandir1 + ) -cagebreak_man = custom_target('cagebreak_config_man', - output : 'cagebreak-config.5', - input : 'man/cagebreak-config.5.md', - command : [pandoc, '-i', '@INPUT@', '-o', '@OUTPUT@', '-f', 'markdown-smart', '-t', 'man', '-s'], - install: true, - install_dir: mandir5 - ) + cagebreak_man = custom_target('cagebreak_config_man', + output : 'cagebreak-config.5', + input : 'man/cagebreak-config.5.md', + command : [pandoc, '-i', '@INPUT@', '-o', '@OUTPUT@', '-f', 'markdown-smart', '-t', 'man', '-s'], + install: true, + install_dir: mandir5 + ) +endif if get_option('fuzz') subdir('fuzz') diff --git a/meson_options.txt b/meson_options.txt index bb96c4f..19d7b86 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,3 +1,4 @@ option('xwayland', type: 'boolean', value: 'false', description: 'Enable support for X11 applications') +option('man-pages', type: 'boolean', value: 'false', description: 'Build man pages using pandoc') option('fuzz', type: 'boolean', value: 'false', description: 'Enable building fuzzer targets') option('version_override', type: 'string', description: 'Set the project version to the string specified. Used for creating hashes for reproducible builds.')