cairo/util/meson.build
Uli Schlachter 1e34651420 Fix meson build without zlib
Trying to build with meson with -Dzlib=disabled failed with the
following error message:

cairo/test/meson.build:599:2: ERROR: Unknown variable
"libcairoscript_dep".

This commit fixes that problem by adding a not-found dependency if
cairo-script is not built.

Additionally, follow-up problems are fixed:

- any2ppm.c still tried to include cairo-script-interpreter.h, which was
  not found
- Building cairo-test-trace was attempted, but that also failed because
  of missing script support.

Fixes: https://gitlab.freedesktop.org/cairo/cairo/-/issues/475
Signed-off-by: Uli Schlachter <psychon@znc.in>
2021-05-22 08:16:47 +02:00

64 lines
1.8 KiB
Meson

subdir('cairo-missing')
cairo_utils = []
if feature_conf.get('CAIRO_HAS_GOBJECT_FUNCTIONS', 0) == 1
subdir('cairo-gobject')
endif
if conf.get('CAIRO_HAS_INTERPRETER', 0) == 1
subdir('cairo-script')
else
libcairoscript_dep = dependency('', required: false)
endif
if conf.get('CAIRO_HAS_TRACE', 0) == 1
subdir('cairo-trace')
if (conf.get('CAIRO_HAS_DLSYM', 0) == 1 and
feature_conf.get('CAIRO_HAS_SCRIPT_SURFACE', 0) == 1 and
feature_conf.get('CAIRO_HAS_TEE_SURFACE', 0) == 1)
subdir('cairo-fdr')
endif
endif
if (glib_dep.found() and
png_dep.found() and
host_machine.system() != 'windows' and
conf.get('CAIRO_HAS_DLSYM', 0) == 1 and
feature_conf.get('CAIRO_HAS_SCRIPT_SURFACE', 0) == 1 and
feature_conf.get('CAIRO_HAS_TEE_SURFACE', 0) == 1)
subdir('cairo-sphinx')
endif
if gtk_dep.found()
cairo_utils += [
['show-contour.c', {'deps': [gtk_dep]}],
['show-traps.c', {'deps': [gtk_dep]}],
['show-edges.c', {'deps': [gtk_dep]}],
['show-polygon.c', {'deps': [gtk_dep]}],
['show-events.c', {'deps': [gtk_dep]}],
['font-view.c', {'deps': [gtk_dep]}],
]
endif
if feature_conf.get('CAIRO_HAS_XML_SURFACE', 0) == 1
expat_dep = dependency('expat', fallback: ['expat', 'expat_dep'])
cairo_utils += [
['trace-to-xml.c', {'deps': [expat_dep]}],
['xml-to-trace.c', {'deps': [expat_dep]}],
]
endif
foreach util : cairo_utils
exe_name = util[0].split('.')[0]
util_deps = util.get(1, {}).get('deps', [])
executable(exe_name, util[0],
include_directories: [incbase],
dependencies: deps + util_deps + [libcairo_dep, libcairoscript_dep],
)
endforeach
if cc.has_header_symbol('malloc.h', '__malloc_hook') and cc.has_header('execinfo.h')
libmallocstats = library('malloc-stats', 'malloc-stats.c')
endif