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.build54
1 files changed, 36 insertions, 18 deletions
diff --git a/Build/source/libs/freetype2/freetype-src/meson.build b/Build/source/libs/freetype2/freetype-src/meson.build
index 0eb780bfd6c..9998848d576 100644
--- a/Build/source/libs/freetype2/freetype-src/meson.build
+++ b/Build/source/libs/freetype2/freetype-src/meson.build
@@ -49,6 +49,7 @@ ft2_pkgconfig_version = run_command(python_exe,
ft2_includes = include_directories('include')
+freetype_includedir = join_paths(get_option('includedir'), 'freetype2')
# Generate a custom `ftmodule.h` version based on the content of
# `modules.cfg`.
@@ -59,7 +60,7 @@ ftmodule_h = custom_target('ftmodule.h',
command: [python_exe, files('builds/meson/parse_modules_cfg.py'),
'--format=ftmodule.h', '@INPUT@', '--output', '@OUTPUT@'],
install: true,
- install_dir: 'include/freetype2/freetype/config',
+ install_dir: join_paths(freetype_includedir, 'freetype/config'),
)
ft2_sources = [ftmodule_h]
@@ -86,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',
@@ -100,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
@@ -231,7 +234,23 @@ else
ft2_sources += 'src/base/ftdebug.c'
endif
+
ft2_deps = []
+common_ldflags = []
+
+
+# Correct compatibility version for OS x.
+#
+# OSX sets the compatibility_version (aka libtools version) differently from
+# the library name.
+#
+if host_machine.system() == 'darwin'
+ # maintain compatibility with autotools on macOS
+ common_ldflags = [
+ '-compatibility_version', ft2_pkgconfig_version.split('.')[0],
+ '-current_version', ft2_pkgconfig_version
+ ]
+endif
# Generate `ftoption.h` based on available dependencies.
@@ -242,20 +261,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
@@ -303,7 +318,7 @@ ftoption_h = custom_target('ftoption.h',
output: 'ftoption.h',
command: ftoption_command,
install: true,
- install_dir: 'include/freetype2/freetype/config',
+ install_dir: join_paths(freetype_includedir, 'freetype/config'),
)
ft2_sources += ftoption_h
ft2_defines += ['-DFT_CONFIG_OPTIONS_H=<ftoption.h>']
@@ -330,7 +345,7 @@ if use_unix_ftsystem_c
output: 'ftconfig.h',
command: ftconfig_command,
install: true,
- install_dir: 'include/freetype2/freetype/config',
+ install_dir: join_paths(freetype_includedir, 'freetype/config'),
)
ft2_sources += ftconfig_h
ft2_defines += ['-DFT_CONFIG_CONFIG_H=<ftconfig.h>']
@@ -345,6 +360,7 @@ ft2_lib = library('freetype',
dependencies: ft2_deps,
install: true,
version: ft2_so_version,
+ link_args: common_ldflags,
)
@@ -361,11 +377,11 @@ meson.override_dependency('freetype2', freetype_dep)
# i.e., the subdir value seems to be ignored, contrary to examples in the
# Meson documentation.
install_headers('include/ft2build.h',
- install_dir: 'include/freetype2')
+ install_dir: freetype_includedir)
install_headers(ft2_public_headers,
- install_dir: 'include/freetype2/freetype')
+ install_dir: join_paths(freetype_includedir, 'freetype'))
install_headers(ft2_config_headers,
- install_dir: 'include/freetype2/freetype/config')
+ install_dir: join_paths(freetype_includedir, 'freetype/config'))
pkgconfig = import('pkgconfig')
@@ -392,18 +408,20 @@ gen_docs = custom_target('freetype2 reference documentation',
command: [python_exe,
files('builds/meson/generate_reference_docs.py'),
'--version=' + meson.project_version(),
- '--input-dir=' + meson.source_root(),
+ '--input-dir=' + meson.current_source_dir(),
'--output-dir=@OUTPUT@'
],
)
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