[libgee/meson: 20/21] Added enable-doc option to Meson




commit 0789c52b78d1b8ac5566becb31839a13de3f2411
Author: Daniel Espinosa <esodan gmail com>
Date:   Wed Nov 22 17:27:59 2017 -0600

    Added enable-doc option to Meson

 doc/meson.build   | 60 ++++++++++++++++++++++++++++++-------------------------
 meson_options.txt |  1 +
 2 files changed, 34 insertions(+), 27 deletions(-)
---
diff --git a/doc/meson.build b/doc/meson.build
index 0bf410f..c320702 100644
--- a/doc/meson.build
+++ b/doc/meson.build
@@ -1,28 +1,34 @@
-valadoc = find_program ('valadoc')
-outdir ='Gee-'+API_VERSION
-valacapi = run_command ('valac', '--api-version')
-driver = '--driver='+valacapi.stdout().strip()
-pkgname = '--package-name='+'Gee-'+API_VERSION
-pkgversion = '--package-version='+PROJECT_VERSION
-vapidir = '--vapidir='+join_paths (meson.current_source_dir (),'gee')
-vapidirvapi = '--vapidir='+join_paths (meson.current_source_dir (),'vapi')
-docsdir = join_paths (get_option ('datadir'), 'devhelp','books')
+enable_doc = get_option('enable-doc')
 
-custom_target ('valadocs',
-               input : valasources,
-               output : outdir,
-               command : [valadoc,
-                       driver,
-                       '--doclet=devhelp',
-                       '--force',
-                       pkgname,
-                       pkgversion,
-                       '--pkg=gio-2.0',
-                       vapidir,
-                       vapidirvapi,
-                       '--vapidir', join_paths (meson.source_root (),'utils'),
-                       '--pkg=geeutils',
-                       '--directory=@OUTDIR@',
-                       valasources],
-               install : true,
-               install_dir : docsdir)
+if enable_doc
+       valadoc = find_program ('valadoc', required: false)
+       if valadoc.found()
+               outdir ='Gee-'+API_VERSION
+               valacapi = run_command ('valac', '--api-version')
+               driver = '--driver='+valacapi.stdout().strip()
+               pkgname = '--package-name='+'Gee-'+API_VERSION
+               pkgversion = '--package-version='+PROJECT_VERSION
+               vapidir = '--vapidir='+join_paths (meson.current_source_dir (),'gee')
+               vapidirvapi = '--vapidir='+join_paths (meson.current_source_dir (),'vapi')
+               docsdir = join_paths (get_option ('datadir'), 'devhelp','books')
+
+               custom_target ('valadocs',
+                               input : valasources,
+                               output : outdir,
+                               command : [valadoc,
+                                       driver,
+                                       '--doclet=devhelp',
+                                       '--force',
+                                       pkgname,
+                                       pkgversion,
+                                       '--pkg=gio-2.0',
+                                       vapidir,
+                                       vapidirvapi,
+                                       '--vapidir', join_paths (meson.source_root (),'utils'),
+                                       '--pkg=geeutils',
+                                       '--directory=@OUTDIR@',
+                                       valasources],
+                               install : true,
+                               install_dir : docsdir)
+       endif
+endif
diff --git a/meson_options.txt b/meson_options.txt
index 8132ec2..70d5cda 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,3 +1,4 @@
 option('enable-benchmark', type : 'boolean', value : false, description : 'Enable benchmark')
 option('disable-internal-asserts', type : 'boolean', value : false, description : 'Disables the internal 
asserts')
 option('enable-consistency-check', type : 'boolean', value : false, description : 'Enables (very) expensive 
consistency checks. It might affect the asymptotic performance.')
+option('enable-doc', type : 'boolean', value : false, description : 'Enable documentation generation')


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