Skip to content

Commit

Permalink
Switch from zlib to zlib-ng
Browse files Browse the repository at this point in the history
Use zlib-ng (in zlib-compat mode) as a better-optimized alternative.  On
macOS, ignore the SDK zlib, except that other SDK libraries will continue
to use it.

Signed-off-by: Benjamin Gilbert <[email protected]>
  • Loading branch information
bgilbert committed Sep 29, 2024
1 parent 934cc2c commit 40bb528
Show file tree
Hide file tree
Showing 5 changed files with 1,238 additions and 20 deletions.
8 changes: 4 additions & 4 deletions common/software.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,10 +427,10 @@ def _sqlite3_license(proj: Project) -> tuple[str, str]:
remove_dirs=['doc', 'tests'],
),
Project(
id='zlib',
display='zlib',
licenses=['README'],
remove_dirs=['contrib', 'doc', 'examples'],
id='zlib-ng',
display='zlib-ng',
licenses=['LICENSE.md'],
remove_dirs=['doc', 'test'],
),
Project(
id='zstd',
Expand Down
15 changes: 12 additions & 3 deletions deps/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ if not all_systems and system == 'darwin'
# [dependency name, library name, version] or
# [dependency name, library name, header with version, version define]
overrides = [
# zlib is handled automatically by dependency()
# no define for libffi version; pick a value that will pass the checks
['libffi', 'ffi', '3.0.0'],
['libxml-2.0', 'xml2', 'libxml/xmlversion.h', 'LIBXML_DOTTED_VERSION'],
Expand Down Expand Up @@ -42,8 +41,18 @@ if not all_systems and system == 'darwin'
'-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ffi',
language : ['c', 'cpp'],
)
else
subproject('zlib')
endif

# ignore SDK zlib on macOS (except as a dependency of the other SDK libs)
meson.override_dependency(
'zlib',
subproject(
'zlib-ng',
default_options : ['tests=disabled', 'zlib-compat=true'],
).get_variable('zlib_ng_dep'),
)

if all_systems or system != 'darwin'
subproject(
'libffi',
default_options : ['tests=false'],
Expand Down
Loading

0 comments on commit 40bb528

Please sign in to comment.