diff options
author | Matthias Clasen <mclasen@redhat.com> | 2022-06-16 07:36:40 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2022-06-22 13:57:26 -0400 |
commit | 38fe9c0783f94b57074506e6f2f4df7b03e0ca65 (patch) | |
tree | 2c86a188864b9a72f6e89e97c105e9bceff01ebf | |
parent | c9d40a19d64731839a21d0ea841ab8fb412bf2cd (diff) | |
download | pango-38fe9c0783f94b57074506e6f2f4df7b03e0ca65.tar.gz |
build: Fix build without cairo
-rw-r--r-- | meson.build | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/meson.build b/meson.build index 51e40c9a..0ebdc346 100644 --- a/meson.build +++ b/meson.build @@ -319,27 +319,22 @@ if host_system == 'windows' ] endif -# If option is 'auto' or 'enabled' it is not required to find cairo on the -# system because a fallback is done at the end. -cairo_option = get_option('cairo') -if not cairo_option.disabled() - cairo_option = false +if get_option('cairo').disabled() + cairo_dep = disabler() + cairo_png_dep = disabler() + cairo_xlib_dep = disabler() +else + cairo_dep = dependency('cairo', version: cairo_req_version, + fallback: ['cairo', 'libcairo_dep'], required: get_option('cairo')) + cairo_png_dep = dependency('cairo-png', required: false) + cairo_xlib_dep = dependency('cairo-xlib', required: false) endif -cairo_dep = dependency('cairo', version: cairo_req_version, - fallback: ['cairo', 'libcairo_dep'], required: get_option('cairo')) - pango_conf.set('HAVE_CAIRO', cairo_dep.found ()) -pango_deps += cairo_dep - -cairo_png_dep = dependency('cairo-png', required: false) -if cairo_png_dep.found() - pango_conf.set('HAVE_CAIRO_PNG', 1) -endif - -cairo_xlib_dep = dependency('cairo-xlib', required: false) -if cairo_xlib_dep.found() - pango_conf.set('HAVE_CAIRO_XLIB', 1) +pango_conf.set('HAVE_CAIRO_PNG', cairo_dep.found() and cairo_png_dep.found()) +pango_conf.set('HAVE_CAIRO_XLIB', cairo_dep.found() and cairo_xlib_dep.found()) +if cairo_dep.found() + pango_deps += cairo_dep endif # libsysprof-capture support |