Skip to content

Commit 77825f7

Browse files
committed
Merge branch 'ps/build-meson-gitweb'
meson-based build still tried to build and install gitweb even when Perl is disabled, which has been corrected. * ps/build-meson-gitweb: meson: skip gitweb build when Perl is disabled
2 parents 77edd59 + 7d549fe commit 77825f7

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

meson.build

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ endif
740740
# features. It is optional if you want to neither execute tests nor use any of
741741
# these optional features.
742742
perl_required = get_option('perl')
743-
if get_option('tests')
743+
if get_option('tests') or get_option('gitweb').enabled()
744744
perl_required = true
745745
endif
746746

@@ -1874,7 +1874,15 @@ if intl.found()
18741874
subdir('po')
18751875
endif
18761876
subdir('contrib')
1877-
subdir('gitweb')
1877+
1878+
# Gitweb requires Perl, so we disable the auto-feature if Perl was not found.
1879+
# We make sure further up that Perl is required in case the gitweb option is
1880+
# enabled.
1881+
gitweb_option = get_option('gitweb').disable_auto_if(not perl.found())
1882+
if gitweb_option.enabled()
1883+
subdir('gitweb')
1884+
endif
1885+
18781886
subdir('templates')
18791887

18801888
# Everything but the bin-wrappers need to come before this target such that we
@@ -1893,6 +1901,7 @@ summary({
18931901
'curl': curl.found(),
18941902
'expat': expat.found(),
18951903
'gettext': intl.found(),
1904+
'gitweb': gitweb_option.enabled(),
18961905
'https': https_backend,
18971906
'iconv': iconv.found(),
18981907
'pcre2': pcre2.found(),

meson_options.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ option('expat', type: 'feature', value: 'enabled',
2323
description: 'Build helpers used to push to remotes with the HTTP transport.')
2424
option('gettext', type: 'feature', value: 'auto',
2525
description: 'Build translation files.')
26+
option('gitweb', type: 'feature', value: 'auto',
27+
description: 'Build Git web interface. Requires Perl.')
2628
option('iconv', type: 'feature', value: 'auto',
2729
description: 'Support reencoding strings with different encodings.')
2830
option('pcre2', type: 'feature', value: 'enabled',

0 commit comments

Comments
 (0)