From 5b1b8f450e882f7cd80f2ba2a44ee781cf599a20 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 5 May 2023 13:29:20 -0400 Subject: Add options to disable html or singlehtml documentation --- doc/c/meson.build | 62 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 33 insertions(+), 29 deletions(-) (limited to 'doc') diff --git a/doc/c/meson.build b/doc/c/meson.build index 3a6a3923..f81a692a 100644 --- a/doc/c/meson.build +++ b/doc/c/meson.build @@ -15,13 +15,13 @@ endif # Generate Sphinx configuration file -config = configuration_data() -config.set('SERD_VERSION', meson.project_version()) -config.set('SERD_SRCDIR', serd_src_root) -config.set('SERD_TITLE', get_option('title')) +conf_config = configuration_data() +conf_config.set('SERD_SRCDIR', serd_src_root) +conf_config.set('SERD_TITLE', get_option('title')) +conf_config.set('SERD_VERSION', meson.project_version()) conf_py = configure_file( - configuration: config, + configuration: conf_config, input: files('../conf.py.in'), output: 'conf.py', ) @@ -57,28 +57,32 @@ endif # TODO: Add install_tag: 'doc' after requiring meson 0.60.0 -custom_target( - 'singlehtml', - build_by_default: true, - command: [ - sphinx_build, - '-M', 'singlehtml', '@OUTDIR@', '@OUTDIR@', '-t', 'singlehtml', - ] + sphinx_flags, - input: [c_rst_files, c_serd_rst, c_index_xml, conf_py], - install: true, - install_dir: docdir / versioned_name, - output: 'singlehtml', -) +if not get_option('singlehtml').disabled() + custom_target( + 'singlehtml', + build_by_default: true, + command: [ + sphinx_build, + '-M', 'singlehtml', '@OUTDIR@', '@OUTDIR@', '-t', 'singlehtml', + ] + sphinx_flags, + input: [c_rst_files, c_serd_rst, c_index_xml, conf_py], + install: true, + install_dir: docdir / versioned_name, + output: 'singlehtml', + ) +endif -custom_target( - 'html', - build_by_default: true, - command: [ - sphinx_build, - '-M', 'html', '@OUTDIR@', '@OUTDIR@', '-t', 'html', - ] + sphinx_flags, - input: [c_rst_files, c_serd_rst, c_index_xml, conf_py], - install: true, - install_dir: docdir / versioned_name, - output: 'html', -) +if not get_option('html').disabled() + custom_target( + 'html', + build_by_default: true, + command: [ + sphinx_build, + '-M', 'html', '@OUTDIR@', '@OUTDIR@', '-t', 'html', + ] + sphinx_flags, + input: [c_rst_files, c_serd_rst, c_index_xml, conf_py], + install: true, + install_dir: docdir / versioned_name, + output: 'html', + ) +endif -- cgit v1.2.1