[docs] Adopt CONFIG.md with meson

This commit is contained in:
Ebrahim Byagowi 2020-08-02 11:22:09 +04:30 committed by GitHub
parent b0a4860d34
commit 9fd48de6f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 8 deletions

View File

@ -1,9 +1,9 @@
# Configuring HarfBuzz # Configuring HarfBuzz
Most of the time you will not need any custom configuration. The configuration Most of the time you will not need any custom configuration. The configuration
options provided by `configure` or `meson` should be enough. In particular, options provided by `meson` should be enough. In particular, if you just want
if you just want HarfBuzz library plus hb-shape / hb-view utilities, make sure HarfBuzz library plus hb-shape / hb-view utilities, make sure FreeType and Cairo
FreeType and Cairo are available and found during configuration. are available and found during configuration.
If you are building for distribution, you should more carefully consider whether If you are building for distribution, you should more carefully consider whether
you need Glib, ICU, Graphite2, as well as CoreText / Uniscribe / DWrite. Make you need Glib, ICU, Graphite2, as well as CoreText / Uniscribe / DWrite. Make
@ -18,9 +18,9 @@ binary size savings.
## Compiler Options ## Compiler Options
Make sure you build with your compiler's "optimize for size" option. On `gcc` Make sure you build with your compiler's "optimize for size" option. On `gcc`
this is `-Os`, and can be enabled by passing `CXXFLAGS=-Os` either to `configure` this is `-Os`, and can be enabled by passing `CXXFLAGS=-Os`. On clang there
(sticky) or to `make` (non-sticky). On clang there is an even more extreme flag, is an even more extreme flag, `-Oz`. Meson also provides `--buildtype=minsize`
`-Oz`. for more convenience.
HarfBuzz heavily uses inline functions and the optimize-size flag can make the HarfBuzz heavily uses inline functions and the optimize-size flag can make the
library smaller by 20% or more. Moreover, sometimes, based on the target CPU, library smaller by 20% or more. Moreover, sometimes, based on the target CPU,
@ -32,8 +32,7 @@ optimizations. Search for `HB_OPTIMIZE_SIZE` for details, if you are using
other compilers, or continue reading. other compilers, or continue reading.
Another compiler option to consider is "link-time optimization", also known as Another compiler option to consider is "link-time optimization", also known as
'lto'. To enable that, with `gcc` or `clang`, add `-flto` to both `CXXFLAGS` 'lto'. To enable that, feel free to use `-Db_lto=true` of meson.
and `LDFLAGS`, either on `configure` invocation (sticky) or on `make` (non-sticky).
This, also, can have a huge impact on the final size, 20% or more. This, also, can have a huge impact on the final size, 20% or more.
Finally, if you are making a static library build or otherwise linking the Finally, if you are making a static library build or otherwise linking the