meson.build: Minor formatting.

This commit is contained in:
Werner Lemberg 2021-03-08 10:30:57 +01:00
parent 7252e35ed2
commit fedd945c3e
1 changed files with 21 additions and 7 deletions

View File

@ -183,6 +183,7 @@ has_fcntl_h = cc.has_header('fcntl.h')
has_sys_mman_h = cc.has_header('sys/mman.h') has_sys_mman_h = cc.has_header('sys/mman.h')
mmap_option = get_option('mmap') mmap_option = get_option('mmap')
if mmap_option.disabled() if mmap_option.disabled()
ft2_sources += files(['src/base/ftsystem.c',]) ft2_sources += files(['src/base/ftsystem.c',])
elif host_machine.system() == 'windows' elif host_machine.system() == 'windows'
@ -231,7 +232,10 @@ ftoption_command = process_header_command
# GZip support # GZip support
zlib_dep = dependency('zlib', required: get_option('zlib'), fallback: 'zlib') zlib_dep = dependency('zlib',
required: get_option('zlib'),
fallback: 'zlib')
if zlib_dep.found() if zlib_dep.found()
ftoption_command += [ ftoption_command += [
'--enable=FT_CONFIG_OPTION_USE_ZLIB', '--enable=FT_CONFIG_OPTION_USE_ZLIB',
@ -244,7 +248,9 @@ else
endif endif
# BZip2 support # BZip2 support
bzip2_dep = cc.find_library('bz2', required: get_option('bzip2')) bzip2_dep = cc.find_library('bz2',
required: get_option('bzip2'))
if bzip2_dep.found() if bzip2_dep.found()
ftoption_command += ['--enable=FT_CONFIG_OPTION_USE_BZIP2'] ftoption_command += ['--enable=FT_CONFIG_OPTION_USE_BZIP2']
ft2_sources += files(['src/bzip2/ftbzip2.c',]) ft2_sources += files(['src/bzip2/ftbzip2.c',])
@ -252,7 +258,10 @@ if bzip2_dep.found()
endif endif
# PNG support # PNG support
libpng_dep = dependency('libpng', required: get_option('png'), fallback: 'libpng') libpng_dep = dependency('libpng',
required: get_option('png'),
fallback: 'libpng')
if libpng_dep.found() if libpng_dep.found()
ftoption_command += ['--enable=FT_CONFIG_OPTION_USE_PNG'] ftoption_command += ['--enable=FT_CONFIG_OPTION_USE_PNG']
ft2_deps += [libpng_dep] ft2_deps += [libpng_dep]
@ -260,15 +269,18 @@ endif
# Harfbuzz support # Harfbuzz support
harfbuzz_dep = dependency('harfbuzz', harfbuzz_dep = dependency('harfbuzz',
version: '>= 2.0.0', version: '>= 2.0.0',
required: get_option('harfbuzz')) required: get_option('harfbuzz'))
if harfbuzz_dep.found() if harfbuzz_dep.found()
ftoption_command += ['--enable=FT_CONFIG_OPTION_USE_HARFBUZZ'] ftoption_command += ['--enable=FT_CONFIG_OPTION_USE_HARFBUZZ']
ft2_deps += [harfbuzz_dep] ft2_deps += [harfbuzz_dep]
endif endif
# Brotli decompression support # Brotli decompression support
brotli_dep = dependency('libbrotlidec', required: get_option('brotli')) brotli_dep = dependency('libbrotlidec',
required: get_option('brotli'))
if brotli_dep.found() if brotli_dep.found()
ftoption_command += ['--enable=FT_CONFIG_OPTION_USE_BROTLI'] ftoption_command += ['--enable=FT_CONFIG_OPTION_USE_BROTLI']
ft2_deps += [brotli_dep] ft2_deps += [brotli_dep]
@ -330,6 +342,7 @@ freetype_dep = declare_dependency(
include_directories: ft2_includes, include_directories: ft2_includes,
link_with: ft2_lib, link_with: ft2_lib,
version: ft2_pkgconfig_version) version: ft2_pkgconfig_version)
meson.override_dependency('freetype2', freetype_dep) meson.override_dependency('freetype2', freetype_dep)
@ -337,7 +350,7 @@ meson.override_dependency('freetype2', freetype_dep)
# i.e., the subdir value seems to be ignored, contrary to examples in the # i.e., the subdir value seems to be ignored, contrary to examples in the
# Meson documentation. # Meson documentation.
install_headers('include/ft2build.h', install_headers('include/ft2build.h',
install_dir: 'include/freetype2') install_dir: 'include/freetype2')
install_headers(ft2_public_headers, install_headers(ft2_public_headers,
install_dir: 'include/freetype2/freetype') install_dir: 'include/freetype2/freetype')
install_headers(ft2_config_headers, install_headers(ft2_config_headers,
@ -345,6 +358,7 @@ install_headers(ft2_config_headers,
pkgconfig = import('pkgconfig') pkgconfig = import('pkgconfig')
pkgconfig.generate(ft2_lib, pkgconfig.generate(ft2_lib,
filebase: 'freetype2', filebase: 'freetype2',
name: 'FreeType 2', name: 'FreeType 2',