From 2e73e605f78d2e6488e34465a8bfa9e4989a057f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 14 Aug 2020 12:35:29 +0200 Subject: [PATCH] doc/meson.build: convert option "documentation" to Meson "feature" This allows automatic optional detection of Sphinx. This will be useful when we start building the manpages with Sphinx, which many users may want to have. --- doc/meson.build | 6 +++++- meson.build | 4 +--- meson_options.txt | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/doc/meson.build b/doc/meson.build index d3a5ad12d..067a03e5c 100644 --- a/doc/meson.build +++ b/doc/meson.build @@ -1,6 +1,10 @@ install_man(['mpd.1', 'mpd.conf.5']) -sphinx = find_program('sphinx-build') +sphinx = find_program('sphinx-build', required: get_option('documentation')) +if not sphinx.found() + subdir_done() +endif + sphinx_output = custom_target( 'HTML documentation', output: 'html', diff --git a/meson.build b/meson.build index f01e078de..c245c4562 100644 --- a/meson.build +++ b/meson.build @@ -543,9 +543,7 @@ install_data( install_dir: join_paths(get_option('datadir'), 'doc', meson.project_name()), ) -if get_option('documentation') - subdir('doc') -endif +subdir('doc') if get_option('test') subdir('test') diff --git a/meson_options.txt b/meson_options.txt index 446fadccd..750120208 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,4 +1,4 @@ -option('documentation', type: 'boolean', value: false, description: 'Build documentation') +option('documentation', type: 'feature', description: 'Build documentation') option('test', type: 'boolean', value: false, description: 'Build the unit tests and debug programs')