* 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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
diff --git a/meson.build b/meson.build
index 5bfa188..5efb33d 100644
--- a/meson.build
+++ b/meson.build
@@ -87,7 +87,7 @@ foreach mod: ft_main_modules
ft2_sources += 'src/@0@/@1@.c'.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 @@ foreach auxmod: ft_aux_modules
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 @@ process_header_command = [python_exe,
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 @@ gen_docs = custom_target('freetype2 reference documentation',
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