From 033c5b8b0b5efdd2dc7c17b55c6e214a3ce865a2 Mon Sep 17 00:00:00 2001 From: Pavel Hrdina Date: Thu, 8 Oct 2020 14:39:38 +0200 Subject: [PATCH] meson: add docs option to enable/disable generating documentation Signed-off-by: Pavel Hrdina Reviewed-by: Andrea Bolognani --- libvirt.spec.in | 1 + meson.build | 6 +++++- meson_options.txt | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index cf6c951593..440704936b 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1184,6 +1184,7 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec) %{?enable_werror} \ -Dexpensive_tests=enabled \ -Dinit_script=systemd \ + -Ddocs=enabled \ %{?arg_login_shell} %meson_build diff --git a/meson.build b/meson.build index f5b108c050..a4aac2f9db 100644 --- a/meson.build +++ b/meson.build @@ -2203,7 +2203,10 @@ subdir('examples') subdir('po') -subdir('docs') +gen_docs = not get_option('docs').disabled() +if gen_docs + subdir('docs') +endif subdir('build-aux') @@ -2428,6 +2431,7 @@ endif misc_summary = { 'Use -Werror': cc_flags.contains('-Werror'), 'Warning Flags': supported_cc_flags, + 'docs': gen_docs, 'DTrace': conf.has('WITH_DTRACE_PROBES'), 'firewalld': conf.has('WITH_FIREWALLD'), 'firewalld-zone': conf.has('WITH_FIREWALLD_ZONE'), diff --git a/meson_options.txt b/meson_options.txt index b3f4d7744f..52b6e31d16 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -7,6 +7,7 @@ option('expensive_tests', type: 'feature', value: 'auto', description: 'set the option('test_coverage', type: 'boolean', value: false, description: 'turn on code coverage instrumentation') option('git_werror', type: 'feature', value: 'auto', description: 'use -Werror if building from GIT') option('rpath', type: 'feature', value: 'auto', description: 'whether to include rpath information in installed binaries and libraries') +option('docs', type: 'feature', value: 'auto', description: 'whether to generate documentation') # build dependencies options -- 2.47.2