diff --git a/src/Makefile.am b/src/Makefile.am index 56dc32d9a..26e56e5f6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -273,16 +273,17 @@ DISTCLEANFILES += \ hb-features.h: hb-features.h.in $(top_builddir)/config.status $(AM_V_GEN) $(SED) \ -e 's/mesondefine HB_HAS_CAIRO/$(HB_HAS_CAIRO_DEF)/' \ + -e 's/mesondefine HB_HAS_CORETEXT/$(HB_HAS_CORETEXT_DEF)/' \ + -e 's/mesondefine HB_HAS_DIRECTWRITE/$(HB_HAS_DIRECTWRITE_DEF)/' \ -e 's/mesondefine HB_HAS_FREETYPE/$(HB_HAS_FREETYPE_DEF)/' \ -e 's/mesondefine HB_HAS_GDI/$(HB_HAS_GDI_DEF)/' \ -e 's/mesondefine HB_HAS_GDI/$(HB_HAS_GDI_DEF)/' \ - -e 's/mesondefine HB_HAS_GRAPHITE/$(HB_HAS_GRAPHITE_DEF)/' \ -e 's/mesondefine HB_HAS_GLIB/$(HB_HAS_GLIB_DEF)/' \ -e 's/mesondefine HB_HAS_GOBJECT/$(HB_HAS_GOBJECT_DEF)/' \ - -e 's/mesondefine HB_HAS_UNISCRIBE/$(HB_HAS_UNISCRIBE_DEF)/' \ - -e 's/mesondefine HB_HAS_DIRECTWRITE/$(HB_HAS_DIRECTWRITE_DEF)/' \ - -e 's/mesondefine HB_HAS_CORETEXT/$(HB_HAS_CORETEXT_DEF)/' \ + -e 's/mesondefine HB_HAS_GRAPHITE/$(HB_HAS_GRAPHITE_DEF)/' \ -e 's/mesondefine HB_HAS_ICU/$(HB_HAS_ICU_DEF)/' \ + -e 's/mesondefine HB_HAS_UNISCRIBE/$(HB_HAS_UNISCRIBE_DEF)/' \ + -e 's/mesondefine HB_HAS_WASM/$(HB_HAS_WASM_DEF)/' \ "$<" > "$@" || ($(RM) "$@"; false) diff --git a/src/harfbuzz.cc b/src/harfbuzz.cc index d7e8a93f3..26e2bc145 100644 --- a/src/harfbuzz.cc +++ b/src/harfbuzz.cc @@ -58,3 +58,5 @@ #include "hb-ucd.cc" #include "hb-unicode.cc" #include "hb-uniscribe.cc" +#include "hb-wasm-api.cc" +#include "hb-wasm-shape.cc" diff --git a/src/hb-features.h.in b/src/hb-features.h.in index d85749ca9..4b27bd5e7 100644 --- a/src/hb-features.h.in +++ b/src/hb-features.h.in @@ -106,6 +106,13 @@ HB_BEGIN_DECLS */ #mesondefine HB_HAS_UNISCRIBE +/** + * HB_HAS_WASM: + * + * Defined if Harfbuzz has been built with WebAssembly support. + */ +#mesondefine HB_HAS_WASM + HB_END_DECLS diff --git a/src/hb-wasm-api.cc b/src/hb-wasm-api.cc index ae5c1835e..1da8347a0 100644 --- a/src/hb-wasm-api.cc +++ b/src/hb-wasm-api.cc @@ -22,6 +22,10 @@ * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. */ +#include "hb.hh" + +#ifdef HAVE_WASM + #include "hb-wasm-api.hh" #define module_inst wasm_runtime_get_module_inst (exec_env) @@ -38,3 +42,5 @@ #undef module_inst hb_user_data_key_t _hb_wasm_ref_type_key = {}; + +#endif diff --git a/src/meson.build b/src/meson.build index f6b33159e..299634719 100644 --- a/src/meson.build +++ b/src/meson.build @@ -429,7 +429,7 @@ custom_target('harfbuzz.cc', output: 'harfbuzz.cc', input: hb_base_sources + hb_glib_sources + hb_ft_sources + hb_graphite2_sources + hb_uniscribe_sources + hb_gdi_sources + - hb_directwrite_sources + hb_coretext_sources, + hb_directwrite_sources + hb_coretext_sources + hb_wasm_sources, command: [find_program('gen-harfbuzzcc.py'), '@OUTPUT@', meson.current_source_dir(), '@INPUT@'], ) @@ -515,6 +515,7 @@ features = [ 'GRAPHITE', 'ICU', 'UNISCRIBE', + 'WASM', ] hb_enabled_features = configuration_data()