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,24 +581,39 @@ 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)
hb_cairo_sources = [ libharfbuzz_cairo_dep = null_dep
'hb-cairo.cc', if conf.get('HAVE_CAIRO', 0) == 1
'hb-cairo-utils.cc' 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, cairo_dep = dependency('cairo')
include_directories: incconfig,
dependencies: [m_dep, cairo_dep], libharfbuzz_cairo = library('harfbuzz-cairo', hb_cairo_sources,
link_with: [libharfbuzz], include_directories: incconfig,
cpp_args: cpp_args + extra_hb_cpp_args, dependencies: [m_dep, cairo_dep],
soversion: hb_so_version, link_with: [libharfbuzz],
version: version, cpp_args: cpp_args + extra_hb_cpp_args,
install: true, soversion: hb_so_version,
darwin_versions: darwin_versions, version: version,
link_language: 'c', 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() if get_option('tests').enabled()
# TODO: MSVC gives the following, # TODO: MSVC gives the following,