From 5ef0375a7de3fd87bc1d9b8df33b4ddd491f3e1b Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Mon, 3 Jul 2023 18:06:17 +0200 Subject: [PATCH] Disable svg glyph renderer when PNG is disabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index c5a65cd33..c4fcd675b 100644 --- a/meson.build +++ b/meson.build @@ -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 ') + if png_dep.found() and \ + cc.has_type('FT_SVG_Document', dependencies: freetype_dep, prefix: '#include ') conf.set('HAVE_FT_SVG_DOCUMENT', 1) if ttx.found() conf.set('CAIRO_CAN_TEST_TTX_FONT', 1)