meson: introduce build option for contrib
We unconditionally wire up building command completion present in the "contrib/" directory. This may or may not be what users want, and we don't provide a way to disable it. Introduce a new "contrib" build option. This option is introduced as an array so that users can manually pick which exact features they want to include from the "contrib" directory. By default, we build and install shell completions, which is a commonly used feature and also the current default. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Patrick Steinhardt committed
Jan 17, 2025 at 10:56 UTC
07892da045c51eb97ad77aabe1ae4c34170ab3b4
2 files changed
+5
-1
contrib/meson.build
+3
-1
@@ -1 +1,3 @@
1
-subdir('completion')
1
+foreach feature : get_option('contrib')
2
+ subdir(feature)
3
+endforeach
meson_options.txt
+2
@@ -27,6 +27,8 @@ option('version', type: 'string', value: '',
27
description: 'Version string reported by git-version(1) and other tools.')
28
29
# Features supported by Git.
30
+option('contrib', type: 'array', value: [ 'completion' ], choices: [ 'completion', 'subtree' ],
31
+ description: 'Contributed features to include.')
32
option('curl', type: 'feature', value: 'enabled',
33
description: 'Build helpers used to access remotes with the HTTP transport.')
34
option('expat', type: 'feature', value: 'enabled',