Work on proper build integration

Install hb-cairo.h and define HB_HAS_CAIRO.
This commit is contained in:
Matthias Clasen 2022-12-25 19:03:50 -05:00 committed by Behdad Esfahbod
parent a7c2e839e1
commit 306645503d
3 changed files with 43 additions and 16 deletions

View File

@ -170,6 +170,7 @@ HB_HAS_CORETEXT
HB_HAS_FREETYPE
HB_HAS_GLIB
HB_HAS_GRAPHITE
HB_HAS_CAIRO
<SUBSECTION Private>
HB_BEGIN_DECLS
HB_END_DECLS

View File

@ -84,6 +84,13 @@ HB_BEGIN_DECLS
*/
#mesondefine HB_HAS_ICU
/**
* HB_HAS_CAIRO:
*
* Defined if Harfbuzz has been built with cairo support.
*/
#mesondefine HB_HAS_CAIRO
HB_END_DECLS

View File

@ -483,6 +483,10 @@ if have_icu and have_icu_builtin
hb_features.set('HB_HAS_ICU', 1)
endif
if conf.get('HAVE_CAIRO', 0) == 1
hb_features.set('HB_HAS_CAIRO', 1)
endif
hb_features_h = configure_file(input: 'hb-features.h.in',
output: 'hb-features.h',
configuration: hb_features,
@ -577,24 +581,39 @@ libharfbuzz_subset_dep = declare_dependency(
dependencies: [m_dep])
meson.override_dependency('harfbuzz-subset', libharfbuzz_subset_dep)
hb_cairo_sources = [
'hb-cairo.cc',
'hb-cairo-utils.cc'
]
libharfbuzz_cairo_dep = null_dep
if conf.get('HAVE_CAIRO', 0) == 1
hb_cairo_sources = [
'hb-cairo.cc',
'hb-cairo-utils.cc'
]
cairo_dep = dependency('cairo')
hb_cairo_headers = [
'hb-cairo.h',
]
libharfbuzz_cairo = library('harfbuzz-cairo', hb_cairo_sources,
include_directories: incconfig,
dependencies: [m_dep, cairo_dep],
link_with: [libharfbuzz],
cpp_args: cpp_args + extra_hb_cpp_args,
soversion: hb_so_version,
version: version,
install: true,
darwin_versions: darwin_versions,
link_language: 'c',
)
cairo_dep = dependency('cairo')
libharfbuzz_cairo = library('harfbuzz-cairo', hb_cairo_sources,
include_directories: incconfig,
dependencies: [m_dep, cairo_dep],
link_with: [libharfbuzz],
cpp_args: cpp_args + extra_hb_cpp_args,
soversion: hb_so_version,
version: version,
install: true,
darwin_versions: darwin_versions,
link_language: 'c',
)
install_headers(hb_cairo_headers, subdir: meson.project_name())
libharfbuzz_cairo_dep = declare_dependency(
link_with: libharfbuzz_cairo,
include_directories: incsrc,
dependencies: [m_dep, cairo_dep])
meson.override_dependency('harfbuzz-cairo', libharfbuzz_cairo_dep)
endif
if get_option('tests').enabled()
# TODO: MSVC gives the following,