diff mbox series

[1/3] meson: add option to disable documentation

Message ID 20230831100438.3946997-1-ross.burton@arm.com (mailing list archive)
State Superseded
Headers show
Series [1/3] meson: add option to disable documentation | expand

Commit Message

Ross Burton Aug. 31, 2023, 10:04 a.m. UTC
From: Ross Burton <ross.burton@arm.com>

Building the documentation shouldn't be mandatory, as it needs asciidoc
and xmlto.  Add a "docs" option, defaulting to true, to control whether
the documentation should be built.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 meson.build       | 15 +++++++++------
 meson_options.txt |  4 ++++
 2 files changed, 13 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/meson.build b/meson.build
index b61c873..506b0e8 100644
--- a/meson.build
+++ b/meson.build
@@ -45,10 +45,13 @@  if cunit_dep.found()
     subdir('utest')
 endif
 subdir('samples')
-subdir('Documentation')
 
-custom_target(
-    'docs',
-    output: 'docs',
-    depends: [html, man],
-    command: ['echo'])
+if get_option('docs')
+    subdir('Documentation')
+
+    custom_target(
+        'docs',
+        output: 'docs',
+        depends: [html, man],
+        command: ['echo'])
+endif
diff --git a/meson_options.txt b/meson_options.txt
index b2294f6..0611216 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -4,6 +4,10 @@ 
 
 option('plugindir', type : 'string',
        description : 'set the plugin dir')
+
+option('docs', type : 'boolean', value: true,
+       description : 'build documentation')
+
 option('htmldir', type : 'string', value : 'share/doc/libtraceevent-doc',
        description : 'directory for HTML documentation')
 option('asciidoctor', type : 'boolean', value: false,