From 06d879251b7ca80c443ccec2dc60720c37ddd2ec Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Mon, 29 Oct 2018 04:12:09 +0000 Subject: [PATCH] Make building the docs optional Fixes #29 Signed-off-by: Yuxuan Shui --- man/meson.build | 16 +++++++++------- meson_options.txt | 2 ++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/man/meson.build b/man/meson.build index 48312c9..289ddec 100644 --- a/man/meson.build +++ b/man/meson.build @@ -1,8 +1,10 @@ mans = ['compton.1', 'compton-trans.1'] -a2x = find_program('a2x') -foreach m : mans - custom_target(m, output: [m], input: [m+'.asciidoc'], - command: [a2x, '--format', 'manpage', '@INPUT@', - '-D', meson.current_build_dir()], - install: true, install_dir: 'share/man/man1/') -endforeach +if get_option('build_docs') + a2x = find_program('a2x') + foreach m : mans + custom_target(m, output: [m], input: [m+'.asciidoc'], + command: [a2x, '--format', 'manpage', '@INPUT@', + '-D', meson.current_build_dir()], + install: true, install_dir: 'share/man/man1/') + endforeach +endif diff --git a/meson_options.txt b/meson_options.txt index 8855fb8..7748df6 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -9,3 +9,5 @@ option('opengl', type: 'boolean', value: true, description: 'Enable features tha option('dbus', type: 'boolean', value: true, description: 'Enable suport for D-Bus remote control') option('xrescheck', type: 'boolean', value: false, description: 'Enable X resource leak checker (for debug only)') + +option('build_docs', type: 'boolean', value: false, description: 'Build documentation and man pages')