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')