[CONFIG] Add HB_CONFIG_OVERRIDE_H to simplify config overrides

This commit is contained in:
Behdad Esfahbod 2021-12-03 11:49:55 -07:00
parent 74b46b29e7
commit b95d252fab
2 changed files with 16 additions and 6 deletions

View File

@ -135,10 +135,17 @@ The pre-defined configurations are:
Most of the time, one of the pre-defined configuration is exactly what one needs.
Sometimes, however, the pre-defined configuration cuts out features that might
be desired in the library. Unfortunately there is no quick way to undo those
configurations from the command-line. But one can add a header file called
`config-override.h` to undefine certain `HB_NO_*` symbols as desired. Then
define `HAVE_CONFIG_OVERRIDE_H` to make `hb-config.hh` include your configuration
overrides at the end.
configurations from the command-line.
However, configuration can still be overridden from a file. To do that, add your
override instructions (mostly `undef` instructions) to a header file and define
the macro `HB_CONFIG_OVERRIDE_H` to the string containing to that header file's
name. HarfBuzz will then include that file at appropriate right place during
configuration.
Up until HarfBuzz 3.1.2 the the configuration override header file's name was
fixed and called `config-override.h`, and was activated by defining the macro
`HAVE_CONFIG_OVERRIDE_H`. That still works.
## Notes

View File

@ -86,8 +86,11 @@
#define HB_NO_LEGACY
#endif
#ifdef HAVE_CONFIG_OVERRIDE_H
#include "config-override.h"
#if defined(HAVE_CONFIG_OVERRIDE_H) || defined(HB_CONFIG_OVERRIDE_H)
#ifndef HB_CONFIG_OVERRIDE_H
#define HB_CONFIG_OVERRIDE_H "config-override.h"
#endif
#include HB_CONFIG_OVERRIDE_H
#endif
/* Closure of options. */