Disable svg glyph renderer when PNG is disabled

When trying to build with -Dpng=disabled with a new enough FreeType
version, the build would fail in cairo-svg-glyph-renderer.c:

    src/cairo-svg-glyph-render.c:1841:15: error: implicit declaration of
    function ‘cairo_image_surface_create_from_png_stream’; did you mean
    ‘cairo_image_surface_create_for_data’?
    [-Werror=implicit-function-declaration]

Fix this by disabling HAVE_FT_SVG_DOCUMENT when png is not enabled.

Fixes: https://gitlab.freedesktop.org/cairo/cairo/-/issues/784
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2023-07-03 18:06:17 +02:00
parent e7aa3a4c09
commit 5ef0375a7d

View file

@ -336,7 +336,8 @@ if freetype_dep.found()
if not cc.links(files('meson-cc-tests/ft_has_color.c'), dependencies: freetype_dep, name: 'FT has color')
conf.set('FT_HAS_COLOR', '(0)')
endif
if cc.has_type('FT_SVG_Document', dependencies: freetype_dep, prefix: '#include <freetype/otsvg.h>')
if png_dep.found() and \
cc.has_type('FT_SVG_Document', dependencies: freetype_dep, prefix: '#include <freetype/otsvg.h>')
conf.set('HAVE_FT_SVG_DOCUMENT', 1)
if ttx.found()
conf.set('CAIRO_CAN_TEST_TTX_FONT', 1)