[json-glib/json-glib-1-4] build: Add a separate option for generating man pages



commit 67c5e4fb8a3b8b74bd9c62650c9ee03cdbb7553c
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Mon Sep 17 22:09:26 2018 +0100

    build: Add a separate option for generating man pages
    
    Instead of having a single option for both API reference and tools
    documentation.

 doc/meson.build   | 44 +++++++++++++++++++++++---------------------
 meson.build       |  6 +-----
 meson_options.txt |  3 +++
 3 files changed, 27 insertions(+), 26 deletions(-)
---
diff --git a/doc/meson.build b/doc/meson.build
index 678853e..7223b2d 100644
--- a/doc/meson.build
+++ b/doc/meson.build
@@ -17,29 +17,31 @@ glib_prefix = dependency('glib-2.0').get_pkgconfig_variable('prefix')
 glib_docpath = join_paths(glib_prefix, 'share', 'gtk-doc', 'html')
 docpath = join_paths(json_datadir, 'gtk-doc', 'html')
 
-gnome.gtkdoc('json-glib',
-             main_xml: 'json-glib-docs.xml',
-             src_dir: [
-               join_paths(meson.source_root(), 'json-glib'),
-               join_paths(meson.build_root(), 'json-glib'),
-             ],
-             dependencies: json_glib_dep,
-             gobject_typesfile: 'json-glib.types',
-             scan_args: [
-               '--rebuild-types',
-               '--ignore-decorators=_JSON_EXTERN',
-               '--ignore-headers=' + ' '.join(private_headers),
-             ],
-             fixxref_args: [
-               '--html-dir=@0@'.format(docpath),
-               '--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
-               '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')),
-               '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')),
-             ],
-             install: true)
+if get_option('docs')
+  gnome.gtkdoc('json-glib',
+               main_xml: 'json-glib-docs.xml',
+               src_dir: [
+                 join_paths(meson.source_root(), 'json-glib'),
+                 join_paths(meson.build_root(), 'json-glib'),
+               ],
+               dependencies: json_glib_dep,
+               gobject_typesfile: 'json-glib.types',
+               scan_args: [
+                 '--rebuild-types',
+                 '--ignore-decorators=_JSON_EXTERN',
+                 '--ignore-headers=' + ' '.join(private_headers),
+               ],
+               fixxref_args: [
+                 '--html-dir=@0@'.format(docpath),
+                 '--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
+                 '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')),
+                 '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')),
+               ],
+               install: true)
+endif
 
 xsltproc = find_program('xsltproc', required: false)
-if xsltproc.found()
+if get_option('man') and xsltproc.found()
   xlstproc_flags = [
     '--nonet',
     '--stringparam', 'man.output.quietly', '1',
diff --git a/meson.build b/meson.build
index 06048e2..500a0e0 100644
--- a/meson.build
+++ b/meson.build
@@ -161,9 +161,5 @@ python3 = import('python3').find_python()
 gen_installed_test = files('build-aux/gen-installed-test.py')
 
 subdir('json-glib')
-
 subdir('po')
-
-if get_option('docs')
-  subdir('doc')
-endif
+subdir('doc')
diff --git a/meson_options.txt b/meson_options.txt
index edaab56..237b725 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -4,3 +4,6 @@ option('introspection',
 option('docs',
        type: 'boolean', value: false,
        description: 'Build the API reference and man pages (requires gtk-doc and xsltproc)')
+option('man',
+       type: 'boolean', value: false,
+       description: 'Build the man pages (requires xsltproc)')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]