Skip to content

Commit

Permalink
meson: add htmldocs option for installing the docs
Browse files Browse the repository at this point in the history
Currently there is a limited set of documentation installed by default.
We already have the sphinx docs wired into the meson build, although
there is no way for the end-user to install them.

Add an `htmldocs` option which guards both build and install of the
docs. Thus people can opt out of, even if they have sphinx installed.

Issue: rauc#1251
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
  • Loading branch information
evelikov-work authored and evelikov committed Oct 24, 2023
1 parent 843464e commit e858bca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
9 changes: 5 additions & 4 deletions docs/meson.build
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
sphinx = find_program('sphinx-build', required: false)

if not sphinx.found()
if not get_option('htmldocs')
subdir_done()
endif

sphinx = find_program('sphinx-build')

sources_doc = files([
'conf.py',
'advanced.rst',
Expand All @@ -27,5 +27,6 @@ custom_target(
output: 'html',
depend_files: sources_doc,
command: [sphinx, '-b', 'html', meson.current_source_dir(), meson.current_build_dir() / 'html'],
build_by_default: false
install: true,
install_dir: join_paths(datadir, 'doc', 'rauc'),
)
5 changes: 5 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ option(
description : 'D-Bus interfaces directory')

# build options
option(
'htmldocs',
type : 'boolean',
value : 'true',
description : 'Enable/Disable html documentation')
option(
'tests',
type : 'boolean',
Expand Down

0 comments on commit e858bca

Please sign in to comment.