[PATCH v2 3/8] meson: improve summary of auto-detected features
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Jul 8, 2025, 07:57 UTC
- Message-ID
- <20250708-b4-pks-meson-cleanups-v2-3-94ac53cd4b95@pks.im>
- In-Reply-To
- <20250708-b4-pks-meson-cleanups-v2-0-94ac53cd4b95@pks.im>
The summary of auto-detected features prints a boolean for every option to tell the user whether or not the feature has been auto-enabled or not. This summary can be improved though, as in some cases this boolean is derived from a dependency. So if we pass in the dependency directly, then Meson knows to both print a boolean and, if the dependency was found, it also prints a version number.
Adapt the code accordingly and enable `bool_yn` so that actual booleans are formatted similarly to dependencies. Before this change:
Auto-detected features
benchmarks : true
curl : true
expat : true
gettext : true
gitweb : true
iconv : true
pcre2 : true
perl : true
python : trueAnd after this change, we now see the version numbers as expected:
Auto-detected features
benchmarks : YES
curl : YES 8.14.1
expat : YES 2.7.1
gettext : YES
gitweb : YES
iconv : YES
pcre2 : YES 10.44
perl : YES
python : YESNote that this change also enables colorization of the boolean options, green for "YES" and red for "NO".
Signed-off-by: Patrick Steinhardt <ps@pks.im> --- meson.build | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/meson.build b/meson.build index 4e41c3007bb..4f22d72641e 100644 --- a/meson.build +++ b/meson.build @@ -2193,15 +2193,15 @@ meson.add_dist_script( summary({ 'benchmarks': get_option('tests') and perl.found() and time.found(), - 'curl': curl.found(), - 'expat': expat.found(), - 'gettext': intl.found(), + 'curl': curl, + 'expat': expat, + 'gettext': intl, 'gitweb': gitweb_option.allowed(), - 'iconv': iconv.found(), - 'pcre2': pcre2.found(), + 'iconv': iconv, + 'pcre2': pcre2, 'perl': perl_features_enabled, 'python': target_python.found(), -}, section: 'Auto-detected features') +}, section: 'Auto-detected features', bool_yn: true) summary({ 'csprng': csprng_backend,
-- 2.50.0.195.g74e6fc65d0.dirty