[meson] Change Zlib configuration option.
* meson_options.txt, meson.build: Change the format of the 'zlib' meson build configuration option to be a combo with the following choices: - none: Do not support gzip-compressed streams at all. - internal: Support gzip-compressed streams using the copy of the gzip sources under src/gzip/, this should only be used during development to ensure these work properly. - external: Support gzip-compressed streams using the 'zlib' Meson subproject, linked as a static library. - system: Support gzip-compressed streams using a system installed version of zlib. - auto: Support gzip-compressed streams using a system installed version of zlib, if available, or using the 'zlib' subproject otherwise. This is the default! - disabled: backward-compatible alias for 'none'. - enabled: backward-compatible alias for 'auto'.
This commit is contained in:
parent
02ba0fc81e
commit
61cbb95c63
46
meson.build
46
meson.build
|
@ -246,15 +246,47 @@ ftoption_command = process_header_command
|
||||||
|
|
||||||
|
|
||||||
# external GZip support
|
# external GZip support
|
||||||
zlib_dep = dependency('zlib',
|
zlib_option = get_option('zlib')
|
||||||
required: get_option('zlib'),
|
|
||||||
fallback: 'zlib')
|
|
||||||
|
|
||||||
if zlib_dep.found()
|
# Backwards-compatible aliases.
|
||||||
ftoption_command += ['--enable=FT_CONFIG_OPTION_SYSTEM_ZLIB']
|
if zlib_option == 'disabled'
|
||||||
|
zlib_option = 'none'
|
||||||
|
elif zlib_option == 'enabled'
|
||||||
|
zlib_option = 'auto'
|
||||||
|
endif
|
||||||
|
|
||||||
|
if zlib_option == 'auto'
|
||||||
|
# First try to find a system installation, otherwise
|
||||||
|
# fallback to the subproject.
|
||||||
|
zlib_dep = dependency('zlib', required: false)
|
||||||
|
if zlib_dep.found()
|
||||||
|
zlib_option = 'system'
|
||||||
|
else
|
||||||
|
zlib_option = 'external'
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
if zlib_option == 'none'
|
||||||
|
ftoption_command += [ '--disable=FT_CONFIG_OPTION_USE_ZLIB' ]
|
||||||
|
elif zlib_option == 'internal'
|
||||||
|
ftoption_command += [ '--enable=FT_CONFIG_OPTION_USE_ZLIB' ]
|
||||||
|
elif zlib_option == 'external'
|
||||||
|
ftoption_command += [ '--enable=FT_CONFIG_OPTION_USE_ZLIB' ]
|
||||||
|
zlib_project = subproject('zlib',
|
||||||
|
required: true,
|
||||||
|
default_options: 'default_library=static')
|
||||||
|
zlib_dep = zlib_project.get_variable('zlib_dep')
|
||||||
|
ft2_deps += [zlib_dep]
|
||||||
|
elif zlib_option == 'system'
|
||||||
|
zlib_dep = dependency('zlib', required: true)
|
||||||
|
assert(zlib_dep.found(), 'Could not find system zlib installation!')
|
||||||
|
ftoption_command += [
|
||||||
|
'--enable=FT_CONFIG_OPTION_USE_ZLIB',
|
||||||
|
'--enable=FT_CONFIG_OPTION_SYSTEM_ZLIB',
|
||||||
|
]
|
||||||
ft2_deps += [zlib_dep]
|
ft2_deps += [zlib_dep]
|
||||||
else
|
else
|
||||||
ftoption_command += ['--disable=FT_CONFIG_OPTION_SYSTEM_ZLIB']
|
assert(false, 'Invalid zlib option ' + zlib_option)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# BZip2 support
|
# BZip2 support
|
||||||
|
@ -400,7 +432,7 @@ gen_docs = custom_target('freetype2 reference documentation',
|
||||||
summary({'OS': host_machine.system(),
|
summary({'OS': host_machine.system(),
|
||||||
}, section: 'Operating System')
|
}, section: 'Operating System')
|
||||||
|
|
||||||
summary({'Zlib': zlib_dep.found() ? 'external' : 'internal',
|
summary({'Zlib': zlib_option,
|
||||||
'Bzip2': bzip2_dep.found() ? 'yes' : 'no',
|
'Bzip2': bzip2_dep.found() ? 'yes' : 'no',
|
||||||
'Png': libpng_dep.found() ? 'yes' : 'no',
|
'Png': libpng_dep.found() ? 'yes' : 'no',
|
||||||
'Harfbuzz': harfbuzz_dep.found() ? 'yes' : 'no',
|
'Harfbuzz': harfbuzz_dep.found() ? 'yes' : 'no',
|
||||||
|
|
|
@ -46,8 +46,8 @@ option('tests',
|
||||||
description: 'Enable FreeType unit and regression tests')
|
description: 'Enable FreeType unit and regression tests')
|
||||||
|
|
||||||
option('zlib',
|
option('zlib',
|
||||||
type: 'feature',
|
type: 'combo',
|
||||||
value: 'auto',
|
choices: ['auto', 'none', 'internal', 'external', 'system', 'disabled', 'enabled'],
|
||||||
description: 'Support reading gzip-compressed font files')
|
description: 'Support reading gzip-compressed font files')
|
||||||
|
|
||||||
# EOF
|
# EOF
|
||||||
|
|
Loading…
Reference in New Issue