Files
harfbuzz/util/meson.build
T
Behdad EsfahbodandClaude Opus 4.6 25e69d9b96 [gpu] Port hb-gpu-demo to options.hh infrastructure
Replace the manual getopt-based demo main with the standard
main_font_text_t / shape_consumer_t composition, getting all
harfbuzz options for free: --variations, --features, --script,
--direction, --face-index, --font-funcs, etc.

New gpu_output_t (in util/gpu-output.hh) implements the output
interface, feeding shaped glyphs to the demo's GL renderer.

Add demo_buffer_add_glyph() and demo_buffer_current_line() to
demo-buffer for glyph-at-a-time insertion (vs the old batch
add_text which did its own shaping).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 16:34:04 -06:00

239 lines
6.5 KiB
Meson

hb_view_sources = [
'hb-view.cc',
]
hb_shape_sources = [
'hb-shape.cc',
]
hb_draw_sources = [
'hb-vector.cc',
]
hb_raster_sources = [
'hb-raster.cc',
]
hb_ft_raster_sources = [
'hb-ft-raster.cc',
]
hb_info_sources = [
'hb-info.cc',
]
hb_subset_cli_sources = [
'hb-subset.cc',
]
# If found, invoke it on our four binaries to build man pages
# If not found, just skip this step
if not get_option('docs').disabled()
help2man = find_program('help2man', required: false)
else
help2man = disabler()
endif
if help2man.found()
help2man_command = ['sh', '-c', help2man.full_path() + ' --help-option=--help-all --no-info -n "$(@INPUT@ --help | head -n 4 | tail -n 1)" --output=$0 @INPUT@', '@OUTPUT@']
help2man_env = environment()
help2man_env.set('HB_UTIL_HELP_VERBOSE', '1')
endif
util_deps = [freetype_dep, cairo_dep, cairo_ft_dep, glib_dep]
if conf.get('HAVE_GLIB', 0) == 1
if conf.get('HAVE_CAIRO', 0) == 1
hb_view = executable('hb-view', hb_view_sources,
cpp_args: cpp_args,
include_directories: [incconfig, incsrc],
dependencies: [util_deps, chafa_dep],
link_with: [libharfbuzz, libharfbuzz_cairo],
install: true,
)
meson.override_find_program('hb-view', hb_view)
if help2man.found()
target = hb_view.name() + '.1'
hb_view_manpage = custom_target(target,
input: hb_view,
output: target,
command: help2man_command,
depends: [hb_view],
env: help2man_env,
install: true,
install_dir: get_option('mandir') / 'man1',
)
endif
else
hb_view = disabler()
endif
hb_shape = executable('hb-shape', hb_shape_sources,
cpp_args: cpp_args,
include_directories: [incconfig, incsrc],
dependencies: [util_deps],
link_with: [libharfbuzz],
install: true,
)
meson.override_find_program('hb-shape', hb_shape)
if not get_option('vector').disabled()
hb_vector = executable('hb-vector', hb_draw_sources,
cpp_args: cpp_args,
include_directories: [incconfig, incsrc],
dependencies: [util_deps],
link_with: [libharfbuzz, libharfbuzz_vector],
install: true,
)
meson.override_find_program('hb-vector', hb_vector)
else
hb_vector = disabler()
endif
if not get_option('raster').disabled()
hb_raster = executable('hb-raster', hb_raster_sources,
cpp_args: cpp_args,
include_directories: [incconfig, incsrc],
dependencies: [util_deps, chafa_dep],
link_with: [libharfbuzz, libharfbuzz_raster],
install: true,
)
meson.override_find_program('hb-raster', hb_raster)
else
hb_raster = disabler()
endif
if conf.get('HAVE_FREETYPE', 0) == 1
hb_ft_raster_util = executable('hb-ft-raster', hb_ft_raster_sources,
cpp_args: cpp_args,
include_directories: [incconfig, incsrc],
dependencies: [util_deps],
link_with: [libharfbuzz],
install: false,
)
hb_ft_raster_all = executable('hb-ft-raster-all', ['hb-ft-raster-all.cc'],
cpp_args: cpp_args,
include_directories: [incconfig, incsrc],
dependencies: [util_deps],
link_with: [libharfbuzz],
install: false,
)
endif
hb_draw_all = executable('hb-draw-all', ['hb-draw-all.c'],
cpp_args: cpp_args,
include_directories: [incconfig, incsrc],
link_with: [libharfbuzz],
install: false,
)
if not get_option('vector').disabled()
hb_vector_svg_all = executable('hb-vector-svg-all', ['hb-vector-svg-all.c'],
cpp_args: cpp_args,
include_directories: [incconfig, incsrc],
link_with: [libharfbuzz, libharfbuzz_vector],
install: false,
)
endif
hb_paint_all = executable('hb-paint-all', ['hb-paint-all.c'],
cpp_args: cpp_args,
include_directories: [incconfig, incsrc],
link_with: [libharfbuzz],
install: false,
)
if not get_option('raster').disabled()
hb_raster_all = executable('hb-raster-all', ['hb-raster-all.cc'],
cpp_args: cpp_args,
include_directories: [incconfig, incsrc],
link_with: [libharfbuzz, libharfbuzz_raster],
install: false,
)
endif
hb_info = executable('hb-info', [hb_info_sources, gobject_enums_h],
cpp_args: cpp_args,
include_directories: [incconfig, incsrc],
dependencies: [util_deps, libharfbuzz_gobject_dep, chafa_dep],
link_with: [libharfbuzz],
install: true,
)
meson.override_find_program('hb-info', hb_info)
if not get_option('subset').disabled()
hb_subset = executable('hb-subset', hb_subset_cli_sources,
cpp_args: cpp_args,
include_directories: [incconfig, incsrc],
dependencies: util_deps,
link_with: [libharfbuzz, libharfbuzz_subset],
install: true,
)
meson.override_find_program('hb-subset', hb_subset)
else
hb_subset = disabler()
endif
if help2man.found()
foreach binary: [hb_shape, hb_raster, hb_vector, hb_info, hb_subset]
target = binary.name() + '.1'
manpage = custom_target(target,
input: binary,
output: target,
command: help2man_command,
depends: [binary],
env: help2man_env,
install: true,
install_dir: get_option('mandir') / 'man1',
)
endforeach
endif
if get_option('experimental_api')
if not get_option('subset').disabled()
test('test-hb-subset-parsing',
executable('test-hb-subset-parsing',
['test-hb-subset-parsing.c'],
cpp_args: cpp_args,
c_args: ['-DHB_EXPERIMENTAL_API'],
include_directories: [incconfig, incsrc],
dependencies: util_deps,
link_with: [libharfbuzz, libharfbuzz_subset],
install: false,
),
workdir : meson.current_source_dir(),
suite: ['util'])
endif
endif
else
# Disable tests that use this
hb_view = disabler()
hb_shape = disabler()
hb_vector = disabler()
hb_info = disabler()
hb_subset = disabler()
endif
if not get_option('gpu').disabled()
subdir('gpu')
if have_gpu_demo_deps and conf.get('HAVE_GLIB', 0) == 1
hb_gpu_util = executable('hb-gpu-demo',
['hb-gpu-demo.cc'] + gpu_demo_sources + gpu_demo_generated,
cpp_args: cpp_args,
include_directories: [incconfig, incsrc],
dependencies: [util_deps, gl_dep, glew_dep, glfw_dep],
link_with: [libharfbuzz, libharfbuzz_gpu],
install: false,
)
endif
hb_gpu_encode_all = executable('hb-gpu-encode-all',
'hb-gpu-encode-all.cc',
cpp_args: cpp_args,
include_directories: [incconfig, incsrc],
link_with: [libharfbuzz, libharfbuzz_gpu],
install: false,
)
endif