2018-05-17 01:28:53 +02:00
|
|
|
project('harfbuzz', 'c', 'cpp',
|
2021-11-20 16:09:15 +01:00
|
|
|
meson_version: '>= 0.55.0',
|
2022-12-16 22:14:57 +01:00
|
|
|
version: '6.0.0',
|
2020-07-06 19:57:39 +02:00
|
|
|
default_options: [
|
2020-08-02 10:04:21 +02:00
|
|
|
'cpp_rtti=false', # Just to support msvc, we are passing -fno-exceptions also anyway
|
2020-07-06 19:57:39 +02:00
|
|
|
'cpp_std=c++11',
|
2020-08-04 12:44:59 +02:00
|
|
|
'wrap_mode=nofallback', # Use --wrap-mode=default to revert, https://github.com/harfbuzz/harfbuzz/pull/2548
|
2020-07-06 19:57:39 +02:00
|
|
|
],
|
2020-07-05 22:01:42 +02:00
|
|
|
)
|
2018-05-17 01:28:53 +02:00
|
|
|
|
2018-12-03 20:51:06 +01:00
|
|
|
hb_version_arr = meson.project_version().split('.')
|
|
|
|
hb_version_major = hb_version_arr[0].to_int()
|
|
|
|
hb_version_minor = hb_version_arr[1].to_int()
|
|
|
|
hb_version_micro = hb_version_arr[2].to_int()
|
|
|
|
|
|
|
|
# libtool versioning
|
|
|
|
hb_version_int = hb_version_major*10000 + hb_version_minor*100 + hb_version_micro
|
2020-08-11 22:20:33 +02:00
|
|
|
hb_libtool_version_info = '@0@:0:@0@'.format(hb_version_int)
|
2018-12-03 20:51:06 +01:00
|
|
|
|
2018-06-05 02:15:43 +02:00
|
|
|
pkgmod = import('pkgconfig')
|
2018-05-17 01:28:53 +02:00
|
|
|
cpp = meson.get_compiler('cpp')
|
2020-07-03 01:58:08 +02:00
|
|
|
null_dep = dependency('', required: false)
|
2018-05-17 01:28:53 +02:00
|
|
|
|
2022-08-02 23:46:04 +02:00
|
|
|
if cpp.get_argument_syntax() == 'msvc'
|
2018-12-01 12:05:27 +01:00
|
|
|
# Ignore several spurious warnings for things HarfBuzz does very commonly.
|
|
|
|
# If a warning is completely useless and spammy, use '/wdXXXX' to suppress it
|
|
|
|
# If a warning is harmless but hard to fix, use '/woXXXX' so it's shown once
|
|
|
|
# NOTE: Only add warnings here if you are sure they're spurious
|
|
|
|
msvc_args = [
|
2020-07-06 19:57:39 +02:00
|
|
|
'/wd4018', # implicit signed/unsigned conversion
|
|
|
|
'/wd4146', # unary minus on unsigned (beware INT_MIN)
|
|
|
|
'/wd4244', # lossy type conversion (e.g. double -> int)
|
|
|
|
'/wd4305', # truncating type conversion (e.g. double -> float)
|
|
|
|
cpp.get_supported_arguments(['/utf-8']), # set the input encoding to utf-8
|
2018-12-01 12:05:27 +01:00
|
|
|
]
|
2020-06-11 16:39:24 +02:00
|
|
|
add_project_arguments(msvc_args, language: ['c', 'cpp'])
|
2018-12-01 12:05:27 +01:00
|
|
|
# Disable SAFESEH with MSVC for libs that use external deps that are built with MinGW
|
|
|
|
# noseh_link_args = ['/SAFESEH:NO']
|
2021-09-14 12:34:25 +02:00
|
|
|
# disable exception handling
|
|
|
|
add_project_arguments(['/EHs-', '/EHc-'], language: 'cpp')
|
2018-12-01 12:05:27 +01:00
|
|
|
endif
|
|
|
|
|
2020-06-05 01:39:07 +02:00
|
|
|
add_project_link_arguments(cpp.get_supported_link_arguments([
|
|
|
|
'-Bsymbolic-functions'
|
2020-06-11 16:39:24 +02:00
|
|
|
]), language: 'c')
|
2020-06-05 01:39:07 +02:00
|
|
|
|
2020-03-14 02:05:38 +01:00
|
|
|
add_project_arguments(cpp.get_supported_arguments([
|
2020-03-11 17:46:36 +01:00
|
|
|
'-fno-exceptions',
|
2020-08-02 10:04:21 +02:00
|
|
|
'-fno-rtti',
|
2020-03-11 17:46:36 +01:00
|
|
|
'-fno-threadsafe-statics',
|
2020-08-02 09:51:51 +02:00
|
|
|
'-fvisibility-inlines-hidden',
|
2020-06-11 16:39:24 +02:00
|
|
|
]), language: 'cpp')
|
2020-03-11 17:46:36 +01:00
|
|
|
|
|
|
|
if host_machine.cpu_family() == 'arm' and cpp.alignment('struct { char c; }') != 1
|
|
|
|
if cpp.has_argument('-mstructure-size-boundary=8')
|
2020-06-11 16:39:24 +02:00
|
|
|
add_project_arguments('-mstructure-size-boundary=8', language: 'cpp')
|
2020-03-11 17:46:36 +01:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2022-01-19 11:53:02 +01:00
|
|
|
if host_machine.system() == 'windows'
|
|
|
|
add_project_arguments(cpp.get_supported_arguments([
|
|
|
|
'-Wa,-mbig-obj'
|
|
|
|
]), language : 'cpp')
|
|
|
|
endif
|
|
|
|
|
2018-05-17 01:28:53 +02:00
|
|
|
check_headers = [
|
|
|
|
['unistd.h'],
|
|
|
|
['sys/mman.h'],
|
|
|
|
['stdbool.h'],
|
2022-01-09 00:47:33 +01:00
|
|
|
['xlocale.h'],
|
2018-05-17 01:28:53 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
check_funcs = [
|
|
|
|
['atexit'],
|
|
|
|
['mprotect'],
|
|
|
|
['sysconf'],
|
|
|
|
['getpagesize'],
|
|
|
|
['mmap'],
|
|
|
|
['isatty'],
|
2022-01-09 00:47:33 +01:00
|
|
|
['uselocale'],
|
|
|
|
['newlocale'],
|
2018-05-17 01:28:53 +02:00
|
|
|
]
|
|
|
|
|
2020-06-11 16:02:13 +02:00
|
|
|
m_dep = cpp.find_library('m', required: false)
|
|
|
|
|
2022-11-08 22:24:08 +01:00
|
|
|
if meson.version().version_compare('>=0.60.0')
|
|
|
|
# pkg-config: freetype2, cmake: Freetype
|
|
|
|
freetype_dep = dependency('freetype2', 'Freetype',
|
2022-09-07 23:35:03 +02:00
|
|
|
required: get_option('freetype'),
|
|
|
|
default_options: ['harfbuzz=disabled'],
|
|
|
|
allow_fallback: true)
|
2022-11-08 22:24:08 +01:00
|
|
|
else
|
|
|
|
# painful hack to handle multiple dependencies but also respect options
|
|
|
|
freetype_opt = get_option('freetype')
|
|
|
|
# we want to handle enabled manually after fallbacks, but also handle disabled normally
|
|
|
|
if freetype_opt.enabled()
|
|
|
|
freetype_opt = false
|
|
|
|
endif
|
|
|
|
# try pkg-config name
|
|
|
|
freetype_dep = dependency('freetype2', method: 'pkg-config', required: freetype_opt)
|
|
|
|
# when disabled, leave it not-found
|
|
|
|
if not freetype_dep.found() and not get_option('freetype').disabled()
|
|
|
|
# Try cmake name
|
|
|
|
freetype_dep = dependency('Freetype', method: 'cmake', required: false)
|
|
|
|
# Subproject fallback, `allow_fallback: true` means the fallback will be
|
|
|
|
# tried even if the freetype option is set to `auto`.
|
|
|
|
if not freetype_dep.found()
|
|
|
|
freetype_dep = dependency('freetype2',
|
|
|
|
method: 'pkg-config',
|
|
|
|
required: get_option('freetype'),
|
|
|
|
default_options: ['harfbuzz=disabled'],
|
|
|
|
allow_fallback: true)
|
|
|
|
endif
|
|
|
|
endif
|
2022-09-07 23:35:03 +02:00
|
|
|
endif
|
2020-03-13 09:15:21 +01:00
|
|
|
|
2022-01-13 17:30:52 +01:00
|
|
|
glib_dep = dependency('glib-2.0', required: get_option('glib'))
|
|
|
|
gobject_dep = dependency('gobject-2.0', required: get_option('gobject'))
|
2021-10-05 19:00:29 +02:00
|
|
|
graphite2_dep = dependency('graphite2', required: get_option('graphite2'))
|
|
|
|
graphite_dep = dependency('graphite2', required: get_option('graphite'))
|
2018-05-17 01:28:53 +02:00
|
|
|
|
2022-11-08 22:24:08 +01:00
|
|
|
if meson.version().version_compare('>=0.60.0')
|
|
|
|
# pkg-config: icu-uc, cmake: ICU but with components
|
|
|
|
icu_dep = dependency('icu-uc', 'ICU',
|
|
|
|
components: 'uc',
|
|
|
|
required: get_option('icu'),
|
|
|
|
default_options: ['harfbuzz=disabled'],
|
|
|
|
allow_fallback: true)
|
|
|
|
else
|
|
|
|
# painful hack to handle multiple dependencies but also respect options
|
|
|
|
icu_opt = get_option('icu')
|
|
|
|
# we want to handle enabled manually after fallbacks, but also handle disabled normally
|
|
|
|
if icu_opt.enabled()
|
|
|
|
icu_opt = false
|
|
|
|
endif
|
|
|
|
# try pkg-config name
|
|
|
|
icu_dep = dependency('icu-uc', method: 'pkg-config', required: icu_opt)
|
|
|
|
# when disabled, leave it not-found
|
|
|
|
if not icu_dep.found() and not get_option('icu').disabled()
|
|
|
|
# Try cmake name
|
|
|
|
icu_dep = dependency('ICU', method: 'cmake', components: 'uc', required: false)
|
|
|
|
# Try again with subproject fallback. `allow_fallback: true` means the
|
|
|
|
# fallback will be tried even if the icu option is set to `auto`, but
|
|
|
|
# we cannot pass this option until Meson 0.59.0, because no wrap file
|
|
|
|
# is checked into git.
|
|
|
|
if not icu_dep.found()
|
|
|
|
icu_dep = dependency('icu-uc',
|
|
|
|
method: 'pkg-config',
|
|
|
|
required: get_option('icu'))
|
|
|
|
endif
|
|
|
|
endif
|
2020-03-13 09:40:20 +01:00
|
|
|
endif
|
|
|
|
|
2022-02-10 09:30:36 +01:00
|
|
|
if icu_dep.found() and icu_dep.type_name() == 'pkgconfig'
|
2022-02-21 08:07:03 +01:00
|
|
|
icu_defs = icu_dep.get_variable(pkgconfig: 'DEFS', default_value: '').split()
|
|
|
|
if icu_defs.length() > 0
|
2022-01-18 02:28:39 +01:00
|
|
|
add_project_arguments(icu_defs, language: ['c', 'cpp'])
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2020-07-03 02:02:32 +02:00
|
|
|
cairo_dep = null_dep
|
|
|
|
cairo_ft_dep = null_dep
|
2020-06-10 14:22:32 +02:00
|
|
|
if not get_option('cairo').disabled()
|
|
|
|
cairo_dep = dependency('cairo', required: false)
|
2020-10-04 03:34:24 +02:00
|
|
|
cairo_ft_dep = dependency('cairo-ft', required: false)
|
2020-06-11 16:02:13 +02:00
|
|
|
|
2020-08-13 06:36:39 +02:00
|
|
|
if (not cairo_dep.found() and
|
2022-08-02 23:46:04 +02:00
|
|
|
cpp.get_argument_syntax() == 'msvc' and
|
2020-08-13 06:36:39 +02:00
|
|
|
cpp.has_header('cairo.h'))
|
|
|
|
cairo_dep = cpp.find_library('cairo', required: false)
|
2020-10-04 03:34:24 +02:00
|
|
|
if cairo_dep.found() and cpp.has_function('cairo_ft_font_face_create_for_ft_face',
|
|
|
|
prefix: '#include <cairo-ft.h>',
|
|
|
|
dependencies: cairo_dep)
|
|
|
|
cairo_ft_dep = cairo_dep
|
|
|
|
endif
|
2020-03-13 09:56:55 +01:00
|
|
|
endif
|
|
|
|
|
2020-06-24 20:11:32 +02:00
|
|
|
if not cairo_dep.found()
|
2021-11-20 16:09:15 +01:00
|
|
|
# Note that we don't have harfbuzz -> cairo -> freetype2 -> harfbuzz fallback
|
|
|
|
# dependency cycle here because we have configured freetype2 above with
|
|
|
|
# harfbuzz support disabled, so when cairo will lookup freetype2 dependency
|
|
|
|
# it will be forced to use that one.
|
2022-01-13 17:30:52 +01:00
|
|
|
cairo_dep = dependency('cairo', required: get_option('cairo'))
|
2022-12-16 18:54:00 +01:00
|
|
|
cairo_ft_required = get_option('cairo').enabled() and get_option('freetype').enabled()
|
|
|
|
cairo_ft_dep = dependency('cairo-ft', required: cairo_ft_required)
|
2018-10-12 16:11:49 +02:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2021-04-23 18:37:58 +02:00
|
|
|
chafa_dep = dependency('chafa', version: '>= 1.6.0', required: get_option('chafa'))
|
|
|
|
|
2018-05-17 01:28:53 +02:00
|
|
|
conf = configuration_data()
|
2018-11-14 21:19:36 +01:00
|
|
|
incconfig = include_directories('.')
|
2020-03-14 02:08:15 +01:00
|
|
|
|
|
|
|
add_project_arguments('-DHAVE_CONFIG_H', language: ['c', 'cpp'])
|
2018-05-17 01:28:53 +02:00
|
|
|
|
|
|
|
warn_cflags = [
|
|
|
|
'-Wno-non-virtual-dtor',
|
|
|
|
]
|
|
|
|
|
2020-03-14 02:08:15 +01:00
|
|
|
cpp_args = cpp.get_supported_arguments(warn_cflags)
|
2018-05-17 01:28:53 +02:00
|
|
|
|
|
|
|
if glib_dep.found()
|
|
|
|
conf.set('HAVE_GLIB', 1)
|
|
|
|
endif
|
|
|
|
|
|
|
|
if gobject_dep.found()
|
|
|
|
conf.set('HAVE_GOBJECT', 1)
|
|
|
|
endif
|
|
|
|
|
|
|
|
if cairo_dep.found()
|
|
|
|
conf.set('HAVE_CAIRO', 1)
|
2022-02-08 18:03:17 +01:00
|
|
|
if cairo_dep.type_name() == 'internal'
|
2022-02-08 21:44:11 +01:00
|
|
|
conf.set('HAVE_CAIRO_USER_FONT_FACE_SET_RENDER_COLOR_GLYPH_FUNC', 1)
|
2022-02-08 18:03:17 +01:00
|
|
|
else
|
|
|
|
check_funcs += [['cairo_user_font_face_set_render_color_glyph_func', {'deps': cairo_dep}]]
|
|
|
|
endif
|
2018-05-17 01:28:53 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
if cairo_ft_dep.found()
|
|
|
|
conf.set('HAVE_CAIRO_FT', 1)
|
|
|
|
endif
|
|
|
|
|
2021-04-23 18:37:58 +02:00
|
|
|
if chafa_dep.found()
|
|
|
|
conf.set('HAVE_CHAFA', 1)
|
|
|
|
endif
|
|
|
|
|
2021-10-05 19:00:29 +02:00
|
|
|
if graphite2_dep.found() or graphite_dep.found()
|
2018-05-17 01:28:53 +02:00
|
|
|
conf.set('HAVE_GRAPHITE2', 1)
|
|
|
|
endif
|
|
|
|
|
|
|
|
if icu_dep.found()
|
|
|
|
conf.set('HAVE_ICU', 1)
|
2020-04-18 22:24:24 +02:00
|
|
|
endif
|
|
|
|
|
2020-05-21 17:03:18 +02:00
|
|
|
if get_option('icu_builtin')
|
2018-05-17 01:28:53 +02:00
|
|
|
conf.set('HAVE_ICU_BUILTIN', 1)
|
|
|
|
endif
|
|
|
|
|
2022-02-08 20:28:00 +01:00
|
|
|
if get_option('experimental_api')
|
|
|
|
conf.set('HB_EXPERIMENTAL_API', 1)
|
|
|
|
endif
|
|
|
|
|
2018-05-17 01:28:53 +02:00
|
|
|
if freetype_dep.found()
|
|
|
|
conf.set('HAVE_FREETYPE', 1)
|
2018-06-05 20:59:29 +02:00
|
|
|
check_freetype_funcs = [
|
|
|
|
['FT_Get_Var_Blend_Coordinates', {'deps': freetype_dep}],
|
|
|
|
['FT_Set_Var_Blend_Coordinates', {'deps': freetype_dep}],
|
|
|
|
['FT_Done_MM_Var', {'deps': freetype_dep}],
|
2022-07-15 21:36:50 +02:00
|
|
|
['FT_Get_Transform', {'deps': freetype_dep}],
|
2018-06-05 20:59:29 +02:00
|
|
|
]
|
2018-05-17 01:28:53 +02:00
|
|
|
|
|
|
|
if freetype_dep.type_name() == 'internal'
|
|
|
|
foreach func: check_freetype_funcs
|
|
|
|
name = func[0]
|
|
|
|
conf.set('HAVE_@0@'.format(name.to_upper()), 1)
|
|
|
|
endforeach
|
|
|
|
else
|
|
|
|
check_funcs += check_freetype_funcs
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2020-06-03 23:52:10 +02:00
|
|
|
gdi_uniscribe_deps = []
|
2020-07-06 19:57:39 +02:00
|
|
|
# GDI (Uniscribe) (Windows)
|
2020-03-13 11:01:17 +01:00
|
|
|
if host_machine.system() == 'windows' and not get_option('gdi').disabled()
|
2020-08-13 13:03:39 +02:00
|
|
|
if (get_option('directwrite').enabled() and
|
|
|
|
not (cpp.has_header('usp10.h') and cpp.has_header('windows.h')))
|
|
|
|
error('GDI/Uniscribe was enabled explicitly, but required headers are missing.')
|
|
|
|
endif
|
2020-07-07 21:56:40 +02:00
|
|
|
|
2020-08-13 13:03:39 +02:00
|
|
|
gdi_deps_found = true
|
2020-07-07 21:56:40 +02:00
|
|
|
foreach usplib : ['usp10', 'gdi32', 'rpcrt4']
|
2020-08-13 06:36:39 +02:00
|
|
|
dep = cpp.find_library(usplib, required: get_option('gdi'))
|
2020-07-07 21:56:40 +02:00
|
|
|
gdi_deps_found = gdi_deps_found and dep.found()
|
|
|
|
gdi_uniscribe_deps += dep
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
if gdi_deps_found
|
2018-11-12 17:56:56 +01:00
|
|
|
conf.set('HAVE_UNISCRIBE', 1)
|
2020-03-13 11:01:17 +01:00
|
|
|
conf.set('HAVE_GDI', 1)
|
2018-11-12 17:56:56 +01:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2020-07-06 19:57:39 +02:00
|
|
|
# DirectWrite (Windows)
|
2018-11-12 17:56:56 +01:00
|
|
|
if host_machine.system() == 'windows' and not get_option('directwrite').disabled()
|
2020-08-13 06:36:39 +02:00
|
|
|
if get_option('directwrite').enabled() and not cpp.has_header('dwrite_1.h')
|
|
|
|
error('DirectWrite was enabled explicitly, but required header is missing.')
|
|
|
|
endif
|
|
|
|
|
2022-07-06 17:52:29 +02:00
|
|
|
conf.set('HAVE_DIRECTWRITE', 1)
|
2018-11-12 17:56:56 +01:00
|
|
|
endif
|
|
|
|
|
2020-07-06 14:00:59 +02:00
|
|
|
# CoreText (macOS)
|
2020-06-03 23:52:10 +02:00
|
|
|
coretext_deps = []
|
2018-11-12 17:56:56 +01:00
|
|
|
if host_machine.system() == 'darwin' and not get_option('coretext').disabled()
|
2020-06-11 16:39:24 +02:00
|
|
|
app_services_dep = dependency('appleframeworks', modules: ['ApplicationServices'], required: false)
|
2018-11-12 17:56:56 +01:00
|
|
|
if cpp.has_type('CTFontRef', prefix: '#include <ApplicationServices/ApplicationServices.h>', dependencies: app_services_dep)
|
2020-06-03 23:52:10 +02:00
|
|
|
coretext_deps += [app_services_dep]
|
2018-11-12 17:56:56 +01:00
|
|
|
conf.set('HAVE_CORETEXT', 1)
|
|
|
|
# On iOS CoreText and CoreGraphics are stand-alone frameworks
|
|
|
|
# Check for a different symbol to avoid getting cached result
|
|
|
|
else
|
2020-06-11 16:39:24 +02:00
|
|
|
coretext_dep = dependency('appleframeworks', modules: ['CoreText'], required: false)
|
|
|
|
coregraphics_dep = dependency('appleframeworks', modules: ['CoreGraphics'], required: false)
|
|
|
|
corefoundation_dep = dependency('appleframeworks', modules: ['CoreFoundation'], required: false)
|
2018-11-12 17:56:56 +01:00
|
|
|
if cpp.has_type('CTRunRef', prefix: '#include <CoreText/CoreText.h>', dependencies: [coretext_dep, coregraphics_dep, corefoundation_dep])
|
2020-06-03 23:52:10 +02:00
|
|
|
coretext_deps += [coretext_dep, coregraphics_dep, corefoundation_dep]
|
2018-11-12 17:56:56 +01:00
|
|
|
conf.set('HAVE_CORETEXT', 1)
|
|
|
|
elif get_option('coretext').enabled()
|
|
|
|
error('CoreText was enabled explicitly, but required headers or frameworks are missing.')
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2018-11-12 17:56:56 +01:00
|
|
|
# threads
|
2020-07-03 01:58:08 +02:00
|
|
|
thread_dep = null_dep
|
2018-05-17 01:28:53 +02:00
|
|
|
if host_machine.system() != 'windows'
|
|
|
|
thread_dep = dependency('threads', required: false)
|
|
|
|
|
|
|
|
if thread_dep.found()
|
|
|
|
conf.set('HAVE_PTHREAD', 1)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
conf.set_quoted('PACKAGE_NAME', 'HarfBuzz')
|
|
|
|
conf.set_quoted('PACKAGE_VERSION', meson.project_version())
|
|
|
|
|
|
|
|
foreach check : check_headers
|
|
|
|
name = check[0]
|
|
|
|
|
|
|
|
if cpp.has_header(name)
|
|
|
|
conf.set('HAVE_@0@'.format(name.to_upper().underscorify()), 1)
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
2020-06-03 23:52:10 +02:00
|
|
|
harfbuzz_extra_deps = []
|
2018-05-17 01:28:53 +02:00
|
|
|
foreach check : check_funcs
|
|
|
|
name = check[0]
|
2018-06-05 20:59:29 +02:00
|
|
|
opts = check.get(1, {})
|
2018-05-17 01:28:53 +02:00
|
|
|
link_withs = opts.get('link_with', [])
|
2018-06-05 20:59:29 +02:00
|
|
|
check_deps = opts.get('deps', [])
|
2018-05-17 01:28:53 +02:00
|
|
|
extra_deps = []
|
|
|
|
found = true
|
|
|
|
|
|
|
|
# First try without linking
|
2018-06-05 20:59:29 +02:00
|
|
|
found = cpp.has_function(name, dependencies: check_deps)
|
2018-05-17 01:28:53 +02:00
|
|
|
|
|
|
|
if not found and link_withs.length() > 0
|
|
|
|
found = true
|
|
|
|
|
|
|
|
foreach link_with : link_withs
|
|
|
|
dep = cpp.find_library(link_with, required: false)
|
|
|
|
if dep.found()
|
2020-03-24 15:45:09 +01:00
|
|
|
extra_deps += dep
|
2018-05-17 01:28:53 +02:00
|
|
|
else
|
2020-03-24 15:45:09 +01:00
|
|
|
found = false
|
2018-05-17 01:28:53 +02:00
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
if found
|
2018-06-05 20:59:29 +02:00
|
|
|
found = cpp.has_function(name, dependencies: check_deps + extra_deps)
|
2018-05-17 01:28:53 +02:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
if found
|
2020-06-03 23:52:10 +02:00
|
|
|
harfbuzz_extra_deps += extra_deps
|
2018-05-17 01:28:53 +02:00
|
|
|
conf.set('HAVE_@0@'.format(name.to_upper()), 1)
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
subdir('src')
|
|
|
|
subdir('util')
|
2018-11-14 11:12:40 +01:00
|
|
|
|
|
|
|
if not get_option('tests').disabled()
|
|
|
|
subdir('test')
|
|
|
|
endif
|
2018-05-17 01:28:53 +02:00
|
|
|
|
2021-01-21 13:39:19 +01:00
|
|
|
if not get_option('benchmark').disabled()
|
|
|
|
subdir('perf')
|
2020-06-09 15:07:36 +02:00
|
|
|
endif
|
|
|
|
|
2020-07-22 15:23:04 +02:00
|
|
|
if not get_option('docs').disabled()
|
2020-05-17 01:12:08 +02:00
|
|
|
subdir('docs')
|
|
|
|
endif
|
|
|
|
|
2018-05-17 01:28:53 +02:00
|
|
|
configure_file(output: 'config.h', configuration: conf)
|
2020-05-21 13:58:24 +02:00
|
|
|
|
2020-08-12 20:34:26 +02:00
|
|
|
build_summary = {
|
|
|
|
'Directories':
|
|
|
|
{'prefix': get_option('prefix'),
|
|
|
|
'bindir': get_option('bindir'),
|
|
|
|
'libdir': get_option('libdir'),
|
|
|
|
'includedir': get_option('includedir'),
|
|
|
|
'datadir': get_option('datadir'),
|
|
|
|
},
|
|
|
|
'Unicode callbacks (you want at least one)':
|
|
|
|
{'Builtin': true,
|
|
|
|
'Glib': conf.get('HAVE_GLIB', 0) == 1,
|
|
|
|
'ICU': conf.get('HAVE_ICU', 0) == 1,
|
|
|
|
},
|
|
|
|
'Font callbacks (the more the merrier)':
|
|
|
|
{'FreeType': conf.get('HAVE_FREETYPE', 0) == 1,
|
|
|
|
},
|
|
|
|
'Dependencies used for command-line utilities':
|
|
|
|
{'Cairo': conf.get('HAVE_CAIRO', 0) == 1,
|
2021-04-23 18:37:58 +02:00
|
|
|
'Chafa': conf.get('HAVE_CHAFA', 0) == 1,
|
2020-08-12 20:34:26 +02:00
|
|
|
},
|
|
|
|
'Additional shapers':
|
|
|
|
{'Graphite2': conf.get('HAVE_GRAPHITE2', 0) == 1,
|
|
|
|
},
|
|
|
|
'Platform shapers (not normally needed)':
|
|
|
|
{'CoreText': conf.get('HAVE_CORETEXT', 0) == 1,
|
|
|
|
'DirectWrite': conf.get('HAVE_DIRECTWRITE', 0) == 1,
|
|
|
|
'GDI/Uniscribe': (conf.get('HAVE_GDI', 0) == 1) and (conf.get('HAVE_UNISCRIBE', 0) == 1),
|
|
|
|
},
|
|
|
|
'Other features':
|
|
|
|
{'Documentation': conf.get('HAVE_GTK_DOC', 0) == 1,
|
|
|
|
'GObject bindings': conf.get('HAVE_GOBJECT', 0) == 1,
|
|
|
|
'Introspection': conf.get('HAVE_INTROSPECTION', 0) == 1,
|
2022-02-08 20:28:00 +01:00
|
|
|
'Experimental APIs': conf.get('HB_EXPERIMENTAL_API', 0) == 1,
|
2021-01-21 13:34:01 +01:00
|
|
|
},
|
|
|
|
'Testing':
|
|
|
|
{'Tests': get_option('tests').enabled(),
|
|
|
|
'Benchmark': get_option('benchmark').enabled(),
|
2020-08-12 20:34:26 +02:00
|
|
|
},
|
|
|
|
}
|
2021-11-20 16:09:15 +01:00
|
|
|
foreach section_title, section : build_summary
|
|
|
|
summary(section, bool_yn: true, section: section_title)
|
|
|
|
endforeach
|