mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-19 22:11:04 +01:00
Fix CI: Filter depend API symbols from exports when depend_api=false
The depend API follows the same pattern as experimental_api: the code is always compiled (guarded by #ifdef HB_DEPEND_API), but symbols should only be exported when the option is enabled. Changes: 1. gen-def.py: Add --depend-api flag and filter list (like --experimental-api) 2. src/meson.build: Pass --depend-api flag when option is enabled This ensures depend symbols are excluded from .def files when depend_api=false (the CI default), fixing macOS check-symbols test failures. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
1 parent
3648c61cb0
commit
ec97c40d5f
3 files changed
+52
-22
No files matched your search
+38
-22
@@ -21,6 +21,44 @@ The dependency graph enables finding the transitive closure of all glyphs
|
||||
reachable from a given input set, which is useful for font subsetting,
|
||||
analyzing glyph coverage, and optimizing font delivery.
|
||||
|
||||
# Building with the Depend API
|
||||
|
||||
The dependency API is optional and controlled by the `depend_api` build option.
|
||||
**This is a highly experimental feature and disabled by default.**
|
||||
|
||||
## Enabling the depend_api option
|
||||
|
||||
```bash
|
||||
meson setup build -Ddepend_api=true
|
||||
meson compile -C build
|
||||
```
|
||||
|
||||
In code, check for availability:
|
||||
|
||||
```c
|
||||
#ifdef HB_DEPEND_API
|
||||
// Use dependency API
|
||||
#endif
|
||||
```
|
||||
|
||||
## Discovering available options
|
||||
|
||||
To see all available HarfBuzz build options, including `depend_api`:
|
||||
|
||||
```bash
|
||||
# After setting up a build directory
|
||||
meson configure build
|
||||
|
||||
# Or to see just the option values
|
||||
meson introspect build --buildoptions | jq '.[] | select(.section == "user")'
|
||||
```
|
||||
|
||||
You can also view all available options in the source file `meson_options.txt`.
|
||||
|
||||
**Important:** This API is experimental and may change without notice. Do not
|
||||
use in production applications without being prepared for breaking changes in
|
||||
future HarfBuzz releases.
|
||||
|
||||
# Usage
|
||||
|
||||
## Basic Example
|
||||
@@ -324,28 +362,6 @@ Each dependency entry returned by `hb_depend_get_glyph_entry()` contains:
|
||||
over-approximation (a known limitation of the static dependency analysis). Closure
|
||||
implementations can use these flags to report which type of over-approximation occurred.
|
||||
|
||||
## Compilation
|
||||
|
||||
The dependency API is optional and controlled by the `depend_api` build option.
|
||||
**This is a highly experimental feature and disabled by default.**
|
||||
|
||||
```bash
|
||||
meson setup build -Ddepend_api=true
|
||||
meson compile -C build
|
||||
```
|
||||
|
||||
In code, check for availability:
|
||||
|
||||
```c
|
||||
#ifdef HB_DEPEND_API
|
||||
// Use dependency API
|
||||
#endif
|
||||
```
|
||||
|
||||
**Important:** This API is experimental and may change without notice. Do not
|
||||
use in production applications without being prepared for breaking changes in
|
||||
future HarfBuzz releases.
|
||||
|
||||
# Implementation Notes
|
||||
|
||||
**⚠️ Warning: Graph Cycles in Invalid Fonts**
|
||||
|
||||
@@ -27,6 +27,17 @@ hb_subset_cff2_get_charstring_data
|
||||
hb_subset_cff2_get_charstrings_index
|
||||
""".splitlines ()
|
||||
symbols = [x for x in symbols if x not in experimental_symbols]
|
||||
|
||||
if '--depend-api' not in sys.argv:
|
||||
# Depend API symbols - only included when depend_api=true
|
||||
depend_symbols = \
|
||||
"""hb_depend_from_face_or_fail
|
||||
hb_depend_get_glyph_entry
|
||||
hb_depend_get_set_from_index
|
||||
hb_depend_print
|
||||
hb_depend_destroy
|
||||
""".splitlines ()
|
||||
symbols = [x for x in symbols if x not in depend_symbols]
|
||||
symbols = "\n".join (symbols)
|
||||
|
||||
result = symbols if os.getenv ('PLAIN_LIST', '') else """EXPORTS
|
||||
|
||||
@@ -630,6 +630,9 @@ gen_def_cmd = [gen_def, '@OUTPUT@', '@INPUT@']
|
||||
if get_option('experimental_api')
|
||||
gen_def_cmd += '--experimental-api'
|
||||
endif
|
||||
if get_option('depend_api')
|
||||
gen_def_cmd += '--depend-api'
|
||||
endif
|
||||
|
||||
# harfbuzz
|
||||
harfbuzz_def = custom_target('harfbuzz.def',
|
||||
|
||||
Reference in new issue
Block a user