kc3-lang/freetype/meson.build

Branch :


Log

Author Commit Date CI Message
5d2fd760 2025-04-26 13:53:24 Provide configuration option to dynamically load the HarfBuzz library. We now request HarfBuzz version 2.6.8 (published in June 2020) or newer to simplify the setup; this version introduced function `hb_ot_layout_lookup_get_glyph_alternates`, which we need for the adjustment database of the auto-hinter. No CMake support yet for dynamic loading. * include/freetype/config/ftoption.h, devel/ftoption.h (FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC): New configuration macro. * builds/unix/configure.raw: Implement `--with-harfbuzz=dynamic`. This gets tested automatically if we can't link with `libharfbuzz`. (ft_option_set, ft_option_unset): Refine. Require at least HarfBuzz version 2.6.8. * meson.build: Do the same as `configure.raw`. * meson_options.txt: Updated. * CMakeLists.txt: Require at least HarfBuzz version 2.6.8.
b4ca23be 2024-10-12 10:57:59 * meson.build: Define DLL_EXPORT for shared library only. Fixes #1298.
78ff3535 2024-10-12 10:51:25 * meson.build: Minor improvements.
34aed655 2024-10-12 10:49:46 * meson.build: Fix `bzip2` option handling.
f4c2a44e 2024-10-12 10:47:38 * meson.build: Add support for compiling with error strings. * meson_options.txt: Document it.
c4e6791f 2024-08-12 20:19:19 * messon.build: Install `include/freetype/ftlogging.h`. Fixes #1292.
a4b4e3ec 2024-08-12 12:43:14 * meson.build: Install `freetype2.m4`. Fixes #1290.
ed8b82ba 2024-08-08 10:28:05 Various minor documentation or formatting fixes.
2cc58904 2024-03-04 12:14:51 meson: Use the standard dependency mechanism to find bzip2 This follows standard conventions in Meson by using the pkg-config file. This change allows Conan to switch to the Meson build system.
47574f7e 2024-01-27 11:11:22 Update all copyright notices.
65f85237 2023-01-17 09:18:25 Update all copyright notices.
63ccaef0 2022-11-14 11:36:25 [meson] Use generated ftmodule.h ftmodule.h is generated at the root of the build directory, but FT_CONFIG_MODULES_H (freetype/config/ftmodule.h) is used instead. This makes the build fail when disabling modules in modules.cfg. * meson.build (harfbuzz_dep): Add '-DFT_CONFIG_MODULES_H=<ftmodule.h>'.
b861b241 2022-05-27 11:26:30 [meson] Disable FreeType in HarfBuzz fallback. This avoids cyclic subproject configuration when the 'harfbuzz' feature is enabled, or `--wrap-mode=forcefallback` is used, but HarfBuzz is built as a subproject. HarfBuzz does the same and disables HarfBuzz support when configuring FreeType as a subproject. * meson.build (harfbuzz_dep): Implement it. * subprojects/harfbuzz.wrap: New file. * .gitlab-ci.yml [windows meson]: Use latest version of the meson 0.59 series, which has a necessary bug fix to make CI work.
d59c7ce1 2022-04-21 08:43:18 [meson] Remove `default_library=both` from `default_options`. It is inconsistent with what all other Meson projects do. It also prevents static linking to FreeType when it is a subproject because `default_options` in a subproject takes precedence on values set on the main project. For example, building 'GStreamer' with `-Ddefault_library=static` would still dynamically link on FreeType unless the user also sets `-Dfreetype2:default_library=static`. * meson.build: Updated. * .gitlab-ci.yml: Retain `both` option for testing.
0bf49bd2 2021-12-25 20:14:11 Add 'svg' module for OT-SVG rendering. * CMakeLists.txt (BASE_SRCS): Add svg module file. * meson.build (ft2_public_headers): Add `otsvg.h`. * modules.cfg (RASTER_MODULES): Add `svg` module. * builds/meson/parse_modules_cfg.py: Add svg module. * include/freetype/config/ftmodule.h: Add `ft_svg_renderer_class`. * include/freetype/fterrdef.h: Add `Invalid_SVG_Document` and `Missing_SVG_Hooks` error codes. * include/freetype/internal/fttrace.h: Add tracing for `otsvg`. * include/freetype/internal/svginterface.h: New file. It adds an interface to enable the presetting hook from the `base` module. * include/freetype/otsvg.h (SVG_Lib_Init_Func, SVG_Lib_Free_Func, SVG_Lib_Render_Func, SVG_Lib_Preset_Slot_Func): New hooks for SVG rendering. (SVG_RendererHooks): New structure to access them. * src/base/ftobjs.c: Include `svginterface.h`. (ft_glyphslot_preset_bitmap): Add code for presetting the slot for SVG glyphs. (ft_add_renderer): Updated. * src/svg/*: New files.
d0cfb4e1 2022-01-11 10:54:10 Update all copyright notices.
0d343863 2021-08-17 17:27:36 [meson] Change Zlib configuration option. * meson_options.txt, meson.build: Change the format of the 'zlib' meson build configuration option to be a combo with the following choices: - none: Do not support gzip-compressed streams at all. - internal: Support gzip-compressed streams using the copy of the gzip sources under `src/gzip/`; this should only be used during development to ensure these work properly. - external: Support gzip-compressed streams using the 'zlib' Meson subproject, linked as a static library. - system: Support gzip-compressed streams using a system-installed version of zlib. - auto: Support gzip-compressed streams using a system-installed version of zlib, if available, or using the 'zlib' subproject otherwise. This is the default. - disabled: Backward-compatible alias for 'none'. - enabled: Backward-compatible alias for 'auto'.
d6a5c577 2021-12-13 23:40:16 * meson.build: Optimize lookup for `python3` program. The python module's `find_installation` method is intended to provide routines for compiling and installing python modules into the `site-packages` directory. It does a couple of slow things, including run an introspection command to scrape sysconfig info from the detected interpreter, which are not needed for the sole use case of invoking the found installation as an executable. Furthermore, when invoked without the name or path of a python binary, it is hardcoded to always look for `python3` corresponding to the interpreter meson itself uses to run. So using `find_installation` did not even allow detecting `python2` as a fallback. Instead, switch to a simple `find_program` lookup that finishes as soon as the program is found.
e342f83c 2021-12-13 22:50:18 * meson.build: Check the return value of `run_command`. By default, errors are not checked and a command that is somehow broken will just capture incorrect output (likely an empty string). Current development versions of meson now raise a warning for this implicit behavior, and advise explicitly setting the `check:` keyword argumend to determine whether a failing return code should be considered an error. Since none of the commands in this project are expected to fail, mark them as required to succeed.
407f31ff 2021-11-21 11:01:37 meson.build: Initialize `common_ldflags`.
896630be 2021-11-21 07:58:50 * meson.build: Fix compatibility version on MacOS. Fixes #1117.
842ec5ed 2021-10-07 00:46:14 meson.build (gen_docs): Use `current_source_dir` instead of `source_root`. These two are not equal when FreeType is used as a subproject, such as in `freetype-demos`. In that case, `source_root` points at the root project, causing the docs build to fail.
09195a82 2021-08-02 12:55:28 * meson.build: Fix zlib support. This commit synchronizes zlib support with both autotools and cmake: If no external zlib is found (or intentionally disabled on the command line), use the internal zlib by undefining `FT_CONFIG_OPTION_SYSTEM_ZLIB` without modifying `FT_CONFIG_OPTION_USE_ZLIB`. Also improve summary output. Problem reported by Moazin.
47b1a541 2021-07-27 23:30:16 * meson.build: Honor `--includedir` instead of hard-coding 'include'. Signed-off-by: Heiko Becker <heirecka@exherbo.org>
c5516e0f 2021-07-12 09:22:48 * meson.build: Fix build for other UNIX systems (e.g., FreeBSD). Without this change the build of `unix/ftsystem.c` fails because the `ftconfig.h` header that defines macros such as `HAVE_UNISTD_H` and `HAVE_FCNTL_H` is only being generated for Linux, macOS, and Cygwin systems: ``` .../builds/unix/ftsystem.c:258:32: error: use of undeclared identifier 'O_RDONLY' file = open( filepathname, O_RDONLY ); ``` Instead of hardcoding a list of operating systems for this check, update the logic that decides whether to build the file and set a boolean flag that can be checked instead.
50d0033f 2021-07-05 05:44:13 meson.build: Minor doc fix.
a399fb89 2021-07-03 16:34:01 meson.build: Minor doc improvements.
6f273f68 2021-06-15 23:12:57 [meson] Add first regression test to FreeType * tests/README.md: documentation explaining how to build and run the tests with the Meson build. * tests/scripts/download-test-fonts.sh: Simple script to download test font files to the 'tests/data/' folder. * meson.build, meson_options.txt, tests/meson.build: Add 'tests' option to enable building and running the test programs, disabled by default. * tests/issue-1063/main.c: Simple regression test to exhibit issue 1063. * .gitignore: Ignore the content of the tests/data/ folder for now.
16947c0e 2021-05-23 05:36:16 * meson.build (ft2_public_headers): Add missing `ftcid.h'. Fixes #1058.
fedd945c 2021-03-08 10:30:57 meson.build: Minor formatting.
7252e35e 2021-03-07 18:13:59 [meson] Fix 'mmap' handling on Windows. * meson.build (ft2_sources): Always use `windows/ftsystem.c` on Windows unless mmap has been disabled. https://gitlab.freedesktop.org/freetype/freetype/-/merge_requests/5#note_829289
bb42afbd 2021-01-17 15:50:08 [meson] Add subproject fallbacks for 'libpng' and 'zlib'. * subprojects/libpng.wrap, subprojects/zlib.wrap: New files. * meson.build: Updated.
d69d9c23 2021-02-13 16:32:26 [meson] Make it work with Windows. * meson.build: Do not process `ftconfig.h` when not using `ftconfig.h.in`. Fixes #1029.
cc90307d 2021-02-10 09:30:40 * meson.build: s/freetype2_dep/freetype_dep/. Many projects (e.g., fontconfig, cairo) hardcode the `freetype_dep` variable name to use FreeType as subproject because that was the variable name in Centricular's Meson port of FreeType. While they should stop hardcoding that variable name, it does not cost us anything to keep using that name to ease transition.
3dbdb78a 2021-02-10 09:25:42 [meson] Fix handling of HarfBuzz library. * meson.build (harfbuzz_dep): Do not fall back to HarfBuzz by default. Otherwise it causes a dependency cycle: cairo => fontconfig => freetype2 => harfbuzz => cairo Meson will still fall back to HarfBuzz subprojects if the `harfbuzz` option is set to `enabled` instead of `auto` and a `subprojects/harfbuzz.wrap` file is present. In that case it is the responsibility of the main project to set the proper options on each subproject to break the dependency cycle. Fixes: #1028.
2c405596 2020-10-26 14:56:05 Meson: Fix dependency lookup and generate ftconfig.h [meson] Fix dependency lookup and generate `ftconfig.h`. - zlib: If not found on the system, meson can build it as a subproject. We thus never use the (outdated) zlib support that comes with FreeType. Doing so has the additional advantage that the zlib code can be shared with other projects like GLib if both are subprojects of an application. - harfbuzz: Build as a subproject if not found on the system. - 'QUESTION: What if the compiler doesn't support `-D` but uses `/D` instead as on Windows?' Answer: Meson translate arguments for us. - visibility: Replace self-made code with meson-specific solution. * meson.build (ft2_defines): Rewrite logic to set and handle it. (process_header_command): New variable, previously called `ftoption_command`. (ftoption_command, ftconfig_command): New variables. (zlib_option): Removed. (zlib_dep): New variable. (ft2_deps): Updated. (harfbuzz_dep): Updated. (ftconfig_h_in, ftconfig_h): New variables. (ft2_sources): Updated. (ft2_lib): Updated, handle visibility. (summary): Updted. * meson_options.txt (zlib): Updated.
e11cc40a 2020-10-26 14:21:19 * meson.build: Fix resource compilation on Windows. This is copied from GStreamer's meson port of FreeType. (ft2_sources): Add both debug and resource file (the latter for Windows only). (ft2_debug_src): Removed.
69e0faa8 2020-10-26 13:39:19 * meson.build: s/ft2_libtool_version/ft2_pkgconfig_version/. (freetype2_dep): Use it. `ft2_libtool_version` would be the shared library version, not the one we should use in file `freetype2.pc`.
0565c5ba 2020-10-26 11:31:19 * meson.build: Use `meson.override_dependency`. This is a new meson mechanism to avoid other projects to hard-code the `freetype2_dep` variable name in their build definition. It also ensures that meson does not mix system and subproject versions of FreeType inside of the same project. Also remove outdated TODO because `declare_dependency` was already there.
5c81e09b 2020-10-26 11:26:04 * meson.build (bzip2_dep): Simplify. We remove `static:false` from `find_library('bz2')`. I don't know whether the previous code was a workaround for an old meson bug, but at least with version >=0.55.0 (which FreeType uses) it picks the shared library when both are available. With this commit, file `freetype2.pc` no longer contains the full path to file `libbz2.so`; instead, it correctly uses `-lbz2`. Note that this is a meson bug is still present in the current version (0.57.0).
1b69fb9b 2020-10-26 11:25:08 * meson.build: Set project version.
bb33f03a 2021-01-27 06:43:41 * builds/windows/ftsystem.c: Add shared memory support on Windows.
209e9841 2021-01-23 14:15:29 Require HarfBuzz 2.0.0. This is needed to make commit f1f9705f9 work. * CMakeLists.txt (HARFBUZZ_MIN_VERSION), builds/unix/configure.raw (harfbuzz_pkg), meson.build (harfbuzz_dep): Updated.
b6e8a712 2021-01-17 07:18:48 Update all copyright notices.
f88c00e4 2021-01-06 19:19:29 * meson.build: Add summary. Based on a patch from Vincent Torri <vincent.torri@gmail.com>.
c6345ca3 2021-01-06 08:55:16 * meson.build: Fix 'png' build option (#59458). Without this patch, 'png' is always required.
768022b9 2020-12-23 11:30:19 meson.build (ft2_defines): Fix builds on Windows.
26e2a895 2020-11-04 21:00:22 * meson.build: Fix .pc file generation. For backwards compatibility we need the libtool version, not the .so number. Reported by Nikolaus.
40c5681a 2020-10-26 18:09:56 * meson.build: Fix 'harfbuzz' and 'brotli' build options (#59347). Without this patch, 'harfbuzz' and 'brotli' are always required. Patch submitted anonymously in Savannah bug report.
3ce0df52 2020-09-22 20:05:37 [meson] Move auxiliary scripts to `builds/meson`. Suggested by Alexei. * scripts/*.py: Move meson scripts to... * builds/meson/*.py: ... this new location. * meson.build: Updated.
66978a58 2020-05-17 18:45:41 Add Meson build project file. Example usage: # Configure Meson build in directory `build-meson` to generate # release binaries comparable to to the ones from the # autotools/make build system. meson setup build-meson \ --prefix=/usr/local \ --buildtype=debugoptimized \ --strip \ -Db_ndebug=true # After configuring the Meson build with the above command, # compile and install to `/usr/local/`; this includes a pkg-config # file. ninja -C build-meson install # Alternatively, compile and install to `/tmp/aa/usr/local/...` # for packaging. DESTDIR=/tmp/aa ninja -C build-meson install # Generate documentation under `build-meson/docs`. ninja -C build-meson docs Library size comparison for stripped `libfreetype.so` generated by all three build systems: - Default build (autotools + libtool): 712 KiB - CMake build (RelWithDebInfo): 712 KiB - Meson build: 712 KiB * meson.build: New top-level Meson build file for the library. * meson_options.txt: New file. It holds user-selectable options for the build, which can be printed with `meson configure`, and selected at `meson setup` or `meson --reconfigure` time with `-D<option>=<value>`. * scripts/parse_modules_cfg.py: A script invoked by `meson.build` to parse `modules.cfg` and extract important information out of it (i.e., the list of modules). * scripts/process_ftoption_h.py: New script invoked by `meson.build` to process the original `ftoption.h` file. It enables or disables configuration macro variables based on the available dependencies. This is similar to what other build systems are using (i.e., Meson's `configure_file()` command is not used here). * scripts/extract_freetype_version.py: New script invoked by `meson.build` to extract the FreeType version number from `<freetype/freetype.h>`. * scripts/extract_libtool_version.py: New script invoked by `meson.build` to extract the libtool `revision_info` data from `builds/unix/configure.raw`, and to generate the corresponding shared library suffix. * scripts/generate_reference_docs.py: New script invoked by `meson.build` to generate the FreeType 2 reference documentation (using the `docwriter` and `mkdocs` packages, which must be already installed).