diff options
author | David Robillard <d@drobilla.net> | 2021-01-09 19:17:31 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2021-03-07 15:32:23 -0500 |
commit | b9d0b9f058807d7253e88d37822c47b5462b65ea (patch) | |
tree | 680357643905465c27857a1f3709ce3518ad7f82 /doc/c | |
parent | 4c663def32cb6c360ab3d9e2f101c903583d1486 (diff) | |
download | serd-b9d0b9f058807d7253e88d37822c47b5462b65ea.tar.gz serd-b9d0b9f058807d7253e88d37822c47b5462b65ea.tar.bz2 serd-b9d0b9f058807d7253e88d37822c47b5462b65ea.zip |
WIP: Switch to Meson
Diffstat (limited to 'doc/c')
-rw-r--r-- | doc/c/Doxyfile.in (renamed from doc/c/Doxyfile) | 9 | ||||
-rw-r--r-- | doc/c/api/meson.build | 5 | ||||
-rw-r--r-- | doc/c/meson.build | 42 | ||||
-rw-r--r-- | doc/c/wscript | 41 | ||||
-rw-r--r-- | doc/c/xml/meson.build | 19 |
5 files changed, 72 insertions, 44 deletions
diff --git a/doc/c/Doxyfile b/doc/c/Doxyfile.in index a88f8ce8..007f2be2 100644 --- a/doc/c/Doxyfile +++ b/doc/c/Doxyfile.in @@ -2,12 +2,13 @@ PROJECT_NAME = Serd PROJECT_BRIEF = "A lightweight library for RDF storage and serialisation" QUIET = YES -WARN_AS_ERROR = NO +WARN_AS_ERROR = YES WARN_IF_UNDOCUMENTED = NO WARN_NO_PARAMDOC = NO JAVADOC_AUTOBRIEF = YES +FULL_PATH_NAMES = NO CASE_SENSE_NAMES = YES HIDE_IN_BODY_DOCS = YES REFERENCES_LINK_SOURCE = NO @@ -28,6 +29,8 @@ PREDEFINED = SERD_ALLOCATED \ SERD_NULLABLE= \ SERD_PURE_FUNC= -INPUT = ../../include/serd/serd.h +RECURSIVE = YES +STRIP_FROM_PATH = @SERD_SRCDIR@ +INPUT = @SERD_SRCDIR@/include -OUTPUT_DIRECTORY = . +OUTPUT_DIRECTORY = @DOX_OUTPUT@ diff --git a/doc/c/api/meson.build b/doc/c/api/meson.build new file mode 100644 index 00000000..1c0cbfee --- /dev/null +++ b/doc/c/api/meson.build @@ -0,0 +1,5 @@ +c_serd_rst = custom_target( + 'Serd C API ReST Documentation', + command: [dox_to_sphinx, '-f', '@INPUT0@', meson.current_build_dir()], + input: [c_index_xml] + c_rst_files, + output: 'serd.rst') diff --git a/doc/c/meson.build b/doc/c/meson.build new file mode 100644 index 00000000..aa5f2f56 --- /dev/null +++ b/doc/c/meson.build @@ -0,0 +1,42 @@ +config = configuration_data() +config.set('SERD_VERSION', meson.project_version()) + +conf_py = configure_file(configuration: config, + input: '../conf.py.in', + output: 'conf.py') + +configure_file(copy: true, input: '../summary.rst', output: 'summary.rst') + +c_rst_files = files( + 'index.rst', + 'overview.rst', +) + +foreach f : c_rst_files + configure_file(copy: true, input: f, output: '@PLAINNAME@') +endforeach + +subdir('xml') +subdir('api') + +docs = custom_target( + 'singlehtml documentation for serd', + command: [sphinx_build, '-M', 'singlehtml', + meson.current_build_dir(), meson.current_build_dir(), + '-E', '-q', '-t', 'singlehtml'], + input: [c_rst_files, c_serd_rst, c_index_xml], + output: 'singlehtml', + build_by_default: true, + install: true, + install_dir: docdir / 'serd-0') + +docs = custom_target( + 'html documentation for serd', + command: [sphinx_build, '-M', 'html', + meson.current_build_dir(), meson.current_build_dir(), + '-E', '-q', '-t', 'html'], + input: [c_rst_files, c_serd_rst, c_index_xml], + output: 'html', + build_by_default: true, + install: true, + install_dir: docdir / 'serd-0') diff --git a/doc/c/wscript b/doc/c/wscript deleted file mode 100644 index 9a524e3a..00000000 --- a/doc/c/wscript +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env python - -def build(bld): - dox_to_sphinx = bld.path.find_node("../../scripts/dox_to_sphinx.py") - index_xml = bld.path.get_bld().make_node("xml/index.xml") - - files = [ - ("../../resources/serd.svg", "sphinx/_static/serd.svg"), - ("../summary.rst", "sphinx/summary.rst"), - ("index.rst", "sphinx/index.rst"), - ("overview.rst", "sphinx/overview.rst"), - ] - - # Run Doxygen to generate XML documentation - bld(features="doxygen", doxyfile="Doxyfile") - - # Substitute variables to make Sphinx configuration file - bld(features="subst", - source="../conf.py.in", - target="sphinx/conf.py", - SERD_VERSION=bld.env.SERD_VERSION) - - # Copy static documentation files to Sphinx build directory - for f in files: - bld(features="subst", is_copy=True, source=f[0], target=f[1]) - - # Generate Sphinx markup from Doxygen XML - bld.add_group() - bld(rule="${PYTHON} " + dox_to_sphinx.abspath() + " -f ${SRC} ${TGT}", - source=index_xml, - target="sphinx/api/") - - doc_dir = bld.env.DOCDIR + "/serd-%s/" % bld.env.SERD_MAJOR_VERSION - - # Run Sphinx to generate HTML documentation - for builder in ["html", "singlehtml"]: - bld(features="sphinx", - sphinx_source=bld.path.get_bld().make_node("sphinx"), - sphinx_output_format=builder, - sphinx_options=["-E", "-q", "-t", builder], - install_path=doc_dir + "c/%s/" % builder) diff --git a/doc/c/xml/meson.build b/doc/c/xml/meson.build new file mode 100644 index 00000000..b7f49323 --- /dev/null +++ b/doc/c/xml/meson.build @@ -0,0 +1,19 @@ +doxygen = find_program('doxygen') + +c_doxygen_input = [] +foreach h : c_headers + c_doxygen_input += ['..' / h] +endforeach + +config = configuration_data() +config.set('SERD_SRCDIR', serd_src_root) +config.set('DOX_OUTPUT', meson.current_build_dir() / '..') + +c_doxyfile = configure_file(configuration: config, + input: '../Doxyfile.in', + output: 'Doxyfile') + +c_index_xml = custom_target('serd-c-index.xml', + command: [doxygen, '@INPUT0@'], + input: [c_doxyfile] + c_header_files, + output: 'index.xml') |