aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-02-06 14:56:45 -0800
committerJunio C Hamano <gitster@pobox.com>2025-02-06 14:56:45 -0800
commit9d0e81e2ae3bd7f6d8a655be53c2396d7af3d2b0 (patch)
tree54481fadf7f95c85d003db2a4b591ce51cb266d5 /meson.build
parent9fad473faed7862855ced123de81a53fa27187d9 (diff)
parent78cdeed4c79d165c915e8de0355cc3fb7f5797c5 (diff)
downloadgit-9d0e81e2ae3bd7f6d8a655be53c2396d7af3d2b0.tar.xz
Merge branch 'ps/zlib-ng'
The code paths to interact with zlib has been cleaned up in preparation for building with zlib-ng. * ps/zlib-ng: ci: make "linux-musl" job use zlib-ng ci: switch linux-musl to use Meson compat/zlib: allow use of zlib-ng as backend git-zlib: cast away potential constness of `next_in` pointer compat/zlib: provide stubs for `deflateSetHeader()` compat/zlib: provide `deflateBound()` shim centrally git-compat-util: move include of "compat/zlib.h" into "git-zlib.h" compat: introduce new "zlib.h" header git-compat-util: drop `z_const` define compat: drop `uncompress2()` compatibility shim
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build24
1 files changed, 18 insertions, 6 deletions
diff --git a/meson.build b/meson.build
index d54184befc..3d56d717c2 100644
--- a/meson.build
+++ b/meson.build
@@ -263,7 +263,6 @@ libgit_sources = [
'compat/nonblock.c',
'compat/obstack.c',
'compat/terminal.c',
- 'compat/zlib-uncompress2.c',
'config.c',
'connect.c',
'connected.c',
@@ -666,7 +665,7 @@ build_options_config.set('GIT_TEST_CMP_USE_COPIED_CONTEXT', '')
build_options_config.set('GIT_TEST_INDEX_VERSION', '')
build_options_config.set('GIT_TEST_OPTS', '')
build_options_config.set('GIT_TEST_PERL_FATAL_WARNINGS', '')
-build_options_config.set('GIT_TEST_UTF8_LOCALE', '')
+build_options_config.set_quoted('GIT_TEST_UTF8_LOCALE', get_option('test_utf8_locale'))
build_options_config.set_quoted('LOCALEDIR', fs.as_posix(get_option('prefix') / get_option('localedir')))
build_options_config.set('GITWEBDIR', fs.as_posix(get_option('prefix') / get_option('datadir') / 'gitweb'))
@@ -799,11 +798,23 @@ else
build_options_config.set('NO_PERL_CPAN_FALLBACKS', '')
endif
-zlib = dependency('zlib', default_options: ['default_library=static', 'tests=disabled'])
-if zlib.version().version_compare('<1.2.0')
- libgit_c_args += '-DNO_DEFLATE_BOUND'
+zlib_backend = get_option('zlib_backend')
+if zlib_backend in ['auto', 'zlib-ng']
+ zlib_ng = dependency('zlib-ng', required: zlib_backend == 'zlib-ng')
+ if zlib_ng.found()
+ zlib_backend = 'zlib-ng'
+ libgit_c_args += '-DHAVE_ZLIB_NG'
+ libgit_dependencies += zlib_ng
+ endif
+endif
+if zlib_backend in ['auto', 'zlib']
+ zlib = dependency('zlib', default_options: ['default_library=static', 'tests=disabled'])
+ if zlib.version().version_compare('<1.2.0')
+ libgit_c_args += '-DNO_DEFLATE_BOUND'
+ endif
+ zlib_backend = 'zlib'
+ libgit_dependencies += zlib
endif
-libgit_dependencies += zlib
threads = dependency('threads', required: false)
if threads.found()
@@ -2012,4 +2023,5 @@ summary({
'sha1': sha1_backend,
'sha1_unsafe': sha1_unsafe_backend,
'sha256': sha256_backend,
+ 'zlib': zlib_backend,
}, section: 'Backends')