Add build options for utils and examples
authorMartin Blanchard <tchaik@gmx.com>
Thu, 6 Sep 2018 23:07:19 +0000 (00:07 +0100)
committerNikolaus Rath <Nikolaus@rath.org>
Fri, 28 Sep 2018 13:48:33 +0000 (14:48 +0100)
Allow skipping utils build & installation (-Dutils=false) and examples
build (-Dexamples=false). By default behaviour is unchanged (both are
true: utils and examples get build).

meson.build
meson_options.txt

index 6d4aef79a0058088fb5e7b56d63801310515680e..7df434b7a1ada0cf549f010e52960e5285b3e857 100644 (file)
@@ -92,10 +92,15 @@ thread_dep = dependency('threads')
 #
 # Read build files from sub-directories
 #
-subdirs = [ 'lib', 'include', 'example', 'doc', 'test' ]
-if not platform.endswith('bsd') and platform != 'dragonfly'
-  subdirs += 'util'
+subdirs = [ 'lib', 'include', 'test' ]
+if get_option('utils') and not platform.endswith('bsd') and platform != 'dragonfly'
+  subdirs += [ 'util', 'doc' ]
 endif
+
+if get_option('examples')
+  subdirs += 'example'
+endif
+
 foreach n : subdirs
     subdir(n)
 endforeach
index 983fcacce29580d7de705aa453bf33106d81d4ed..c08e38e4b58d5324750532b8767ca1c7104da7c4 100644 (file)
@@ -3,3 +3,9 @@ option('disable-mtab', type : 'boolean', value : false,
 
 option('udevrulesdir', type : 'string', value : '',
        description: 'Where to install udev rules (if empty, query pkg-config(1))')
+
+option('utils', type : 'boolean', value : true,
+       description: 'Wheter or not to build and install helper programs')
+
+option('examples', type : 'boolean', value : true,
+       description: 'Wheter or not to build example programs')
\ No newline at end of file