summaryrefslogtreecommitdiff
path: root/Build/source/libs/freetype2/freetype-src/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/freetype2/freetype-src/meson.build')
-rw-r--r--Build/source/libs/freetype2/freetype-src/meson.build72
1 files changed, 16 insertions, 56 deletions
diff --git a/Build/source/libs/freetype2/freetype-src/meson.build b/Build/source/libs/freetype2/freetype-src/meson.build
index 5bf94c30ca2..9998848d576 100644
--- a/Build/source/libs/freetype2/freetype-src/meson.build
+++ b/Build/source/libs/freetype2/freetype-src/meson.build
@@ -2,7 +2,7 @@
# Meson project file for FreeType 2
#
-# Copyright (C) 2020-2022 by
+# Copyright (C) 2020-2021 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -27,8 +27,7 @@ project('freetype2', 'c',
meson_version: '>= 0.55.0',
default_options: ['default_library=both'],
version: run_command('builds/meson/extract_freetype_version.py',
- 'include/freetype/freetype.h',
- check: true).stdout().strip(),
+ 'include/freetype/freetype.h').stdout().strip(),
)
@@ -36,18 +35,17 @@ project('freetype2', 'c',
# variable; we thus use an external command to have this functionality
# with older versions, too.
-python_exe = find_program('python3')
+python = import('python')
+python_exe = python.find_installation(required: true)
ft2_so_version = run_command(python_exe,
files('builds/meson/extract_libtool_version.py'),
'--soversion',
- files('builds/unix/configure.raw'),
- check: true).stdout().strip()
+ files('builds/unix/configure.raw')).stdout().strip()
ft2_pkgconfig_version = run_command(python_exe,
files('builds/meson/extract_libtool_version.py'),
- files('builds/unix/configure.raw'),
- check: true).stdout().strip()
+ files('builds/unix/configure.raw')).stdout().strip()
ft2_includes = include_directories('include')
@@ -72,8 +70,7 @@ ft2_sources = [ftmodule_h]
ft_main_modules = run_command(python_exe,
files('builds/meson/parse_modules_cfg.py'),
'--format=main-modules',
- files('modules.cfg'),
- check: true).stdout().strip().split()
+ files('modules.cfg')).stdout().strip().split()
ft2_sources += files([
'src/base/ftbase.c',
@@ -94,8 +91,7 @@ endforeach
ft_aux_modules = run_command(python_exe,
files('builds/meson/parse_modules_cfg.py'),
'--format=aux-modules',
- files('modules.cfg'),
- check: true).stdout().strip().split()
+ files('modules.cfg')).stdout().strip().split()
foreach auxmod: ft_aux_modules
source = auxmod
@@ -121,8 +117,7 @@ endforeach
base_extensions = run_command(python_exe,
files('builds/meson/parse_modules_cfg.py'),
'--format=base-extensions-list',
- files('modules.cfg'),
- check: true).stdout().split()
+ files('modules.cfg')).stdout().split()
foreach ext: base_extensions
ft2_sources += files('src/base/' + ext)
@@ -172,7 +167,6 @@ ft2_public_headers = files([
'include/freetype/fttrigon.h',
'include/freetype/fttypes.h',
'include/freetype/ftwinfnt.h',
- 'include/freetype/otsvg.h',
'include/freetype/t1tables.h',
'include/freetype/ttnameid.h',
'include/freetype/tttables.h',
@@ -268,49 +262,15 @@ ftoption_command = process_header_command
# external GZip support
-zlib_option = get_option('zlib')
+zlib_dep = dependency('zlib',
+ required: get_option('zlib'),
+ fallback: 'zlib')
-# Backwards-compatible aliases.
-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 fall back 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',
- ]
+if zlib_dep.found()
+ ftoption_command += ['--enable=FT_CONFIG_OPTION_SYSTEM_ZLIB']
ft2_deps += [zlib_dep]
else
- assert(false, 'Invalid zlib option ' + zlib_option)
+ ftoption_command += ['--disable=FT_CONFIG_OPTION_SYSTEM_ZLIB']
endif
# BZip2 support
@@ -457,7 +417,7 @@ gen_docs = custom_target('freetype2 reference documentation',
summary({'OS': host_machine.system(),
}, section: 'Operating System')
-summary({'Zlib': zlib_option,
+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',