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_FREETYPE
HB_HAS_GLIB HB_HAS_GLIB
HB_HAS_GRAPHITE HB_HAS_GRAPHITE
HB_HAS_CAIRO
<SUBSECTION Private> <SUBSECTION Private>
HB_BEGIN_DECLS HB_BEGIN_DECLS
HB_END_DECLS HB_END_DECLS

View File

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

View File

@ -483,6 +483,10 @@ if have_icu and have_icu_builtin
hb_features.set('HB_HAS_ICU', 1) hb_features.set('HB_HAS_ICU', 1)
endif 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', hb_features_h = configure_file(input: 'hb-features.h.in',
output: 'hb-features.h', output: 'hb-features.h',
configuration: hb_features, configuration: hb_features,
@ -577,11 +581,17 @@ libharfbuzz_subset_dep = declare_dependency(
dependencies: [m_dep]) dependencies: [m_dep])
meson.override_dependency('harfbuzz-subset', libharfbuzz_subset_dep) meson.override_dependency('harfbuzz-subset', libharfbuzz_subset_dep)
libharfbuzz_cairo_dep = null_dep
if conf.get('HAVE_CAIRO', 0) == 1
hb_cairo_sources = [ hb_cairo_sources = [
'hb-cairo.cc', 'hb-cairo.cc',
'hb-cairo-utils.cc' 'hb-cairo-utils.cc'
] ]
hb_cairo_headers = [
'hb-cairo.h',
]
cairo_dep = dependency('cairo') cairo_dep = dependency('cairo')
libharfbuzz_cairo = library('harfbuzz-cairo', hb_cairo_sources, libharfbuzz_cairo = library('harfbuzz-cairo', hb_cairo_sources,
@ -596,6 +606,15 @@ libharfbuzz_cairo = library('harfbuzz-cairo', hb_cairo_sources,
link_language: 'c', 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() if get_option('tests').enabled()
# TODO: MSVC gives the following, # TODO: MSVC gives the following,
# error LNK2019: unresolved external symbol "unsigned __int64 const * const _hb_NullPool" # error LNK2019: unresolved external symbol "unsigned __int64 const * const _hb_NullPool"