diff mbox series

[3/3] meson: enable auto-discovered "gitweb"

Message ID 20241227-b4-pks-meson-wo-gitweb-v1-3-14ca8515bb3b@pks.im (mailing list archive)
State New
Headers show
Series t: fix tests with NO_GITWEB=YesPlease | expand

Commit Message

Patrick Steinhardt Dec. 27, 2024, 12:10 p.m. UTC
In 7d549fe317 (meson: skip gitweb build when Perl is disabled,
2024-12-20) we have started to conditionally enable "gitweb" based on
whether or not Perl is enabled. By accident though that change causes us
to not build gitweb in case its feature flag is set to "auto" even if
autoconfiguration determines that it could be built. This is because we
use "gitweb_option.enabled()", which only checks whether the feature has
been explicitly enabled.

Fix the issue by using `gitweb_option.allowed()` instead, which returns
true in case it is either explicitly enabled or set to "auto". This also
works for the case where the feature becomes auto-disabled due to Perl
not being present because we use `disable_auto_if(not perl.found())`.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 meson.build | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/meson.build b/meson.build
index 3e57793862e5fc15685b5f0fac7f7223af7bef1f..0064eb64f546a6349a8694ce251bd352febda6fe 100644
--- a/meson.build
+++ b/meson.build
@@ -1863,7 +1863,7 @@  subdir('contrib')
 # We make sure further up that Perl is required in case the gitweb option is
 # enabled.
 gitweb_option = get_option('gitweb').disable_auto_if(not perl.found())
-if gitweb_option.enabled()
+if gitweb_option.allowed()
   subdir('gitweb')
   build_options_config.set('NO_GITWEB', '')
 else
@@ -1916,7 +1916,7 @@  summary({
   'curl': curl.found(),
   'expat': expat.found(),
   'gettext': intl.found(),
-  'gitweb': gitweb_option.enabled(),
+  'gitweb': gitweb_option.allowed(),
   'https': https_backend,
   'iconv': iconv.found(),
   'pcre2': pcre2.found(),