In #3811 / commit 53a194aa3f a broken and
half-implemented approach to kind of sort of handling the detection of
both pkg-config and cmake names for dependencies, was implemented. It
just checked for both versions with required: false, but when the build
was configured with *disabled* options, it was still found because it
was treated as auto.
Really, the problem here is trying to outsmart Meson, which handles a
lot of edge cases correctly. But it's possible, albeit very wordy, to
manually implement Meson's internal logic via if/else fallbacks. Do so
here.
It is wrong to search for a different name depending on the compiler. If
anything, cmake name could be available on systems that uses GCC too.
This also fix regression in the usage of freetype subproject fallback as
its name is "freetype2" and was previously used even when the
"freetype" option was set to "auto".
Nowadays Meson has much better CMake support which we can use to find
dependencies on Visual Studio builds (and Visual Studio 2017 and later provides
CMake as an optional install item), so we can use it to help us find ICU-UC
on Visual Studio builds, since CMake has built-in support for finding it by
the components we need for some time.
Nowadays, CMake is much better supported with Meson and is a common tool on
Windows (it is even an optionally-installed item for Visual Studio 2017+), so
make use of that to find FreeType. The package to search for, however, is
`freetype` instead of `freetype2`.
Update to the current master branch so that is has
cairo_user_font_face_set_render_color_glyph_func().
I had to disable optimized builds on win[32|64] crossbuild setups
because they are now broken in the CI (something about cairo defining
_FORTIFY_SOURCE for optimized builds that MingW does not like).
In some cases we need to add additionl defs to build against icu if
icu has certain options configured.
ICU warns about this when building:
*** WARNING: You must set the following flags before code compiled against this ICU will function properly:
-DU_DISABLE_RENAMING=1
We can fetch these flags from the icu pkgconfig and add them if
required.
This fixes symbol errors if ICU is built without renaming.
We implicitly require it for building ragel subproject. This new version
requirement should satisfied in both Fedora 33 and Debian bullseye, and
not be too cutting edge for us.
If ragel 6.10 is not found, build it from source.
Seems to work, except that ragel uses exceptions and we configure
HarfBuzz build to not use exceptions, and I can’t find away to enable
exceptions only for the ragel subproject. I had to remove cpp_eh=none
from default options and try to disable exceptions in MSVC manually
(other compilers are already handled).
Ragel 7 is also not stable from upstream's point of view.
This uses “version” argument find_program(), which was introduced in
meson 0.52.0, so I raised the minimum required meson version
accordingly.