Skip to content

Commit

Permalink
doc/meson.build: convert option "documentation" to Meson "feature"
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
MaxKellermann committed Aug 14, 2020
1 parent 2bcd851 commit 2e73e60
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 5 additions & 1 deletion 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',
Expand Down
4 changes: 1 addition & 3 deletions meson.build
Expand Up @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion 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')

Expand Down

0 comments on commit 2e73e60

Please sign in to comment.