]> git.ipfire.org Git - thirdparty/git.git/commitdiff
meson: introduce build option for contrib
authorPatrick Steinhardt <ps@pks.im>
Fri, 17 Jan 2025 09:56:06 +0000 (10:56 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 17 Jan 2025 17:56:38 +0000 (09:56 -0800)
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>
contrib/meson.build
meson_options.txt

index a7b77b87c22c8f1d8a86faaafc2b647b94651db8..d74b64a5181d6680ec08918d27391306962b4db8 100644 (file)
@@ -1 +1,3 @@
-subdir('completion')
+foreach feature : get_option('contrib')
+  subdir(feature)
+endforeach
index f50bb40cdf6046529a0cea0a03a8cb696c3a6b18..4f02c9252401c2020be5d13d3ad00fdd05663168 100644 (file)
@@ -27,6 +27,8 @@ option('version', type: 'string', value: '',
   description: 'Version string reported by git-version(1) and other tools.')
 
 # Features supported by Git.
+option('contrib', type: 'array', value: [ 'completion' ], choices: [ 'completion', 'subtree' ],
+  description: 'Contributed features to include.')
 option('curl', type: 'feature', value: 'enabled',
   description: 'Build helpers used to access remotes with the HTTP transport.')
 option('expat', type: 'feature', value: 'enabled',