From 9df2469e514d4a5739de9ca045dea9e612aca804 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 14 Aug 2020 12:37:02 +0200 Subject: [PATCH] meson_options.txt: add option html_manual --- doc/meson.build | 62 +++++++++++++++++++++++++---------------------- meson_options.txt | 1 + 2 files changed, 34 insertions(+), 29 deletions(-) diff --git a/doc/meson.build b/doc/meson.build index 067a03e5c..630a25d20 100644 --- a/doc/meson.build +++ b/doc/meson.build @@ -1,37 +1,41 @@ install_man(['mpd.1', 'mpd.conf.5']) +if not get_option('html_manual') + subdir_done() +endif + sphinx = find_program('sphinx-build', required: get_option('documentation')) if not sphinx.found() subdir_done() endif -sphinx_output = custom_target( - 'HTML documentation', - output: 'html', - input: [ - 'index.rst', 'user.rst', 'developer.rst', - 'plugins.rst', - 'protocol.rst', - 'conf.py', - ], - command: [sphinx, '-q', '-b', 'html', '-d', '@OUTDIR@/doctrees', meson.current_source_dir(), '@OUTPUT@'], - build_by_default: true, - install: true, - install_dir: join_paths(get_option('datadir'), 'doc', meson.project_name()), -) +if get_option('html_manual') + sphinx_output = custom_target( + 'HTML documentation', + output: 'html', + input: [ + 'index.rst', 'user.rst', 'developer.rst', + 'plugins.rst', + 'protocol.rst', + 'conf.py', + ], + command: [sphinx, '-q', '-b', 'html', '-d', '@OUTDIR@/doctrees', meson.current_source_dir(), '@OUTPUT@'], + build_by_default: true, + install: true, + install_dir: join_paths(get_option('datadir'), 'doc', meson.project_name()), + ) -custom_target( - 'upload', - input: sphinx_output, - output: 'upload', - build_always_stale: true, - command: [ - 'rsync', '-vpruz', '--delete', meson.current_build_dir() + '/', - 'www.musicpd.org:/var/www/mpd/doc/', - '--chmod=Dug+rwx,Do+rx,Fug+rw,Fo+r', - '--include=html', '--include=html/**', - '--exclude=*', - ], -) - - + custom_target( + 'upload', + input: sphinx_output, + output: 'upload', + build_always_stale: true, + command: [ + 'rsync', '-vpruz', '--delete', meson.current_build_dir() + '/', + 'www.musicpd.org:/var/www/mpd/doc/', + '--chmod=Dug+rwx,Do+rx,Fug+rw,Fo+r', + '--include=html', '--include=html/**', + '--exclude=*', + ], + ) +endif diff --git a/meson_options.txt b/meson_options.txt index 750120208..cb70c133e 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,4 +1,5 @@ option('documentation', type: 'feature', description: 'Build documentation') +option('html_manual', type: 'boolean', value: true, description: 'Build the HTML manual') option('test', type: 'boolean', value: false, description: 'Build the unit tests and debug programs')