diff options
author | Chun-wei Fan <fanchunwei@src.gnome.org> | 2020-04-24 12:36:35 +0800 |
---|---|---|
committer | Kjell Ahlstedt <kjellahlstedt@gmail.com> | 2020-04-25 09:54:21 +0200 |
commit | 3a090b4cf8885b5fbe73a1ba44bc61395f5a4564 (patch) | |
tree | db3de56e3bbf6ff04d3757bb7ac4c04399ab91a2 /data | |
parent | 65b3b5309ba4ef29b0f7247000dab105bb055098 (diff) |
meson: Improve installing pkg-config files
We need to search for the headers and/or functions manually if the pkg-config
files for Cairo are not found.
Diffstat (limited to 'data')
-rw-r--r-- | data/meson.build | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/data/meson.build b/data/meson.build index 554a9c7..5d9567c 100644 --- a/data/meson.build +++ b/data/meson.build @@ -30,7 +30,25 @@ foreach cairomm_mod : ['ft', 'pdf', 'png', 'ps', 'quartz', 'quartz-font', 'quartz-image', 'svg', 'win32', 'win32-font', 'xlib', 'xlib-xrender'] # Install the module only if there is a corresponding cairo module. - do_install = dependency('cairo-' + cairomm_mod, required: false).found() + if cairo_dep.type_name() == 'pkgconfig' + do_install = dependency('cairo-' + cairomm_mod, required: false).found() + else + if cairomm_mod == 'png' + do_install = cpp_compiler.has_function('cairo_surface_write_to_png', + prefix: '#include <cairo.h>', + dependencies: cairo_dep) + elif cairomm_mod == 'quartz-font' + do_install = cpp_compiler.has_function('cairo_quartz_font_face_create_for_cgfont', + prefix: '#include <cairo-quartz.h>', + dependencies: cairo_dep) + elif cairomm_mod == 'win32-font' + do_install = cpp_compiler.has_function('cairo_win32_font_face_create_for_hfont', + prefix: '#include <cairo-win32.h>', + dependencies: cairo_dep) + else + do_install = cpp_compiler.has_header('cairo-@0@.h'.format(cairomm_mod)) + endif + endif pc_file = 'cairomm-' + cairomm_mod configure_file( input: pc_file + '.pc.in', |