summaryrefslogtreecommitdiffstats
path: root/doc/meson.build
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-10-23 13:41:54 -0400
committerDavid Robillard <d@drobilla.net>2022-10-23 14:57:45 -0400
commitbc4b359747466f760f8861dad6d99d7005ff6a04 (patch)
tree5ef45925bdcc016629fde220078f625e9dc8c3d5 /doc/meson.build
parent5891e6fb17de98fae6764bdff929bcaa21a1b36c (diff)
downloadzix-bc4b359747466f760f8861dad6d99d7005ff6a04.tar.gz
zix-bc4b359747466f760f8861dad6d99d7005ff6a04.tar.bz2
zix-bc4b359747466f760f8861dad6d99d7005ff6a04.zip
Build reference documentation
Diffstat (limited to 'doc/meson.build')
-rw-r--r--doc/meson.build78
1 files changed, 78 insertions, 0 deletions
diff --git a/doc/meson.build b/doc/meson.build
new file mode 100644
index 0000000..f406624
--- /dev/null
+++ b/doc/meson.build
@@ -0,0 +1,78 @@
+# Copyright 2021-2022 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: 0BSD OR ISC
+
+docdir = get_option('datadir') / 'doc'
+
+doxygen = find_program('doxygen', required: get_option('docs'))
+dox_to_sphinx = find_program('../scripts/dox_to_sphinx.py')
+sphinx_build = find_program('sphinx-build', required: get_option('docs'))
+
+build_docs = doxygen.found() and sphinx_build.found()
+if build_docs
+
+ # Documentation Code
+
+ test(
+ 'overview_code',
+ executable(
+ 'overview_code',
+ files('overview_code.c'),
+ dependencies: [zix_dep],
+ c_args: c_suppressions,
+ )
+ )
+
+ # Generated API Reference
+
+ c_rst_files = files(
+ 'index.rst',
+ 'string_views.rst',
+ 'summary.rst',
+ 'using_zix.rst',
+ )
+
+ c_doc_files = c_rst_files + files(
+ 'conf.py',
+ 'overview_code.c',
+ )
+
+ foreach f : c_doc_files
+ configure_file(copy: true, input: f, output: '@PLAINNAME@')
+ endforeach
+
+ subdir('xml')
+ subdir('api')
+
+ sphinx_options = [
+ '-D', 'release=@0@'.format(meson.project_version()),
+ '-E',
+ '-W',
+ '-a',
+ '-q',
+ ]
+
+ doc_inputs = c_rst_files + [c_zix_rst, c_index_xml]
+
+ custom_target(
+ 'singlehtml',
+ build_by_default: true,
+ command: [sphinx_build, '-M', 'singlehtml', '@OUTDIR@', '@OUTDIR@',
+ '-t', 'singlehtml'] + sphinx_options,
+ input: doc_inputs,
+ install: true,
+ install_dir: docdir / versioned_name,
+ output: 'singlehtml',
+ )
+
+ custom_target(
+ 'html',
+ build_by_default: true,
+ command: [sphinx_build, '-M', 'html', '@OUTDIR@', '@OUTDIR@',
+ '-t', 'html'] + sphinx_options,
+ input: doc_inputs,
+ install: true,
+ install_dir: docdir / versioned_name,
+ output: 'html',
+ )
+
+endif