ref: 09195a82a4a39afb0f8281563f48ce4493455b4e
parent: be6ab319009c5de7927adb0228412627783499e5
author: Werner Lemberg <[email protected]>
date: Mon Aug 2 08:55:28 EDT 2021
* meson.build: Fix zlib support. This commit synchronizes zlib support with both autotools and cmake: If no external zlib is found (or intentionally disabled on the command line), use the internal zlib by undefining `FT_CONFIG_OPTION_SYSTEM_ZLIB` without modifying `FT_CONFIG_OPTION_USE_ZLIB`. Also improve summary output. Problem reported by Moazin.
--- a/meson.build
+++ b/meson.build
@@ -87,7 +87,7 @@
ft2_sources += 'src/@0@/@[email protected]'.format(mod, source)
endforeach
-# NOTE: The `gzip` and `bzip2` aux modules are handled through options.
+# NOTE: The `bzip2` aux module is handled through options.
ft_aux_modules = run_command(python_exe,
files('builds/meson/parse_modules_cfg.py'),
'--format=aux-modules',
@@ -101,7 +101,9 @@
source = 'ftcache'
elif auxmod == 'lzw'
source = 'ftlzw'
- elif auxmod == 'gzip' or auxmod == 'bzip2'
+ elif auxmod == 'gzip'
+ source = 'ftgzip'
+ elif auxmod == 'bzip2'
# Handled through options instead, see below.
continue
endif
@@ -243,20 +245,16 @@
ftoption_command = process_header_command
-# GZip support
+# external GZip support
zlib_dep = dependency('zlib',
required: get_option('zlib'),
fallback: 'zlib')
if zlib_dep.found()
- ftoption_command += [
- '--enable=FT_CONFIG_OPTION_USE_ZLIB',
- '--enable=FT_CONFIG_OPTION_SYSTEM_ZLIB',
- ]
- ft2_sources += files(['src/gzip/ftgzip.c',])
+ ftoption_command += ['--enable=FT_CONFIG_OPTION_SYSTEM_ZLIB']
ft2_deps += [zlib_dep]
else
- ftoption_command += ['--disable=FT_CONFIG_OPTION_USE_ZLIB']
+ ftoption_command += ['--disable=FT_CONFIG_OPTION_SYSTEM_ZLIB']
endif
# BZip2 support
@@ -400,11 +398,13 @@
summary({'OS': host_machine.system(),
- 'Zlib': zlib_dep.found() ? 'yes' : 'no',
+ }, section: 'Operating System')
+
+summary({'Zlib': zlib_dep.found() ? 'external' : 'internal',
'Bzip2': bzip2_dep.found() ? 'yes' : 'no',
'Png': libpng_dep.found() ? 'yes' : 'no',
'Harfbuzz': harfbuzz_dep.found() ? 'yes' : 'no',
'Brotli': brotli_dep.found() ? 'yes' : 'no',
- }, section: 'Configuration Options Summary:')
+ }, section: 'Used Libraries')
# EOF