Commit f8967015 authored by Xavier Claessens's avatar Xavier Claessens
Browse files

meson: cairo-ft depends on fontconfig if available

cairo-ft.h includes fontconfig.h when CAIRO_HAS_FC_FONT is defined, so
it must appear in the pc file and the corresponding
declare_dependency(). This fix build issue in harfbuzz when cairo and
fontconfig are built as subproject.
parent 70c01fb9
......@@ -179,6 +179,35 @@ if png_dep.found()
endif
endif
fontconfig_dep = dependency('fontconfig',
required: get_option('fontconfig'),
version: fontconfig_required_version,
fallback: ['fontconfig', 'fontconfig_dep'],
)
if fontconfig_dep.found()
fc_check_funcs = [
'FcInit',
'FcFini'
]
if fontconfig_dep.type_name() == 'internal'
foreach func : fc_check_funcs
conf.set('HAVE_@0@'.format(func.to_upper()), 1)
endforeach
internal_deps += [fontconfig_dep]
else
check_funcs += fc_check_funcs
deps += [fontconfig_dep]
endif
feature_conf.set('CAIRO_HAS_FC_FONT', 1)
built_features += [{
'name': 'cairo-fc',
'description': 'Fontconfig font backend',
'deps': [fontconfig_dep],
}]
endif
freetype_dep = dependency('freetype2',
required: get_option('freetype'),
version: freetype_required_version,
......@@ -190,6 +219,8 @@ if freetype_dep.found()
'name': 'cairo-ft',
'description': 'Freetype font backend',
'deps': [freetype_dep],
# cairo-ft.h includes fontconfig.h so it needs its cflags
'compile-deps': [fontconfig_dep.partial_dependency(compile_args: true, includes: true)],
}]
ft_check_funcs = [
......@@ -216,35 +247,6 @@ if freetype_dep.found()
endif
endif
fontconfig_dep = dependency('fontconfig',
required: get_option('fontconfig'),
version: fontconfig_required_version,
fallback: ['fontconfig', 'fontconfig_dep'],
)
if fontconfig_dep.found()
fc_check_funcs = [
'FcInit',
'FcFini'
]
if fontconfig_dep.type_name() == 'internal'
foreach func : fc_check_funcs
conf.set('HAVE_@0@'.format(func.to_upper()), 1)
endforeach
internal_deps += [fontconfig_dep]
else
check_funcs += fc_check_funcs
deps += [fontconfig_dep]
endif
feature_conf.set('CAIRO_HAS_FC_FONT', 1)
built_features += [{
'name': 'cairo-fc',
'description': 'Fontconfig font backend',
'deps': [fontconfig_dep],
}]
endif
x11_dep = dependency('x11', required: get_option('xlib'))
xext_dep = dependency('xext', required: get_option('xlib'))
if x11_dep.found() and xext_dep.found()
......@@ -865,13 +867,14 @@ configure_file(output: 'config.h', configuration: conf)
foreach feature: built_features
feature_deps = feature.get('deps', [])
feature_libs = feature.get('libs', [])
feature_compile_deps = feature.get('compile-deps', [])
pkgmod.generate(libraries: [libcairo] + feature_deps + feature_libs,
name: feature['name'],
description: feature['description'] + ' for cairo graphics library',
)
meson.override_dependency(feature['name'],
declare_dependency(link_with: libcairo,
dependencies: feature_deps,
dependencies: feature_deps + feature_compile_deps,
link_args: feature_libs,
)
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment