meson: Fix check for cairo and cairo-ft dependencies
When cairo comes from a subproject fallback it should still take cairo-ft dependency, otherwise it miss freetype2 cflags. Also update wrap file to use upstream repository now that meson support has been merged. This requires Meson >= 0.54.0 because cairo itself requires that version and we use the new `fallback: 'cairo'` syntax without specifying a variable name because cairo does not provide a variable name for cairo-ft.
This commit is contained in:
parent
c4ade4fdd6
commit
e2ba0e009e
37
meson.build
37
meson.build
|
@ -127,34 +127,31 @@ cairo_dep = null_dep
|
||||||
cairo_ft_dep = null_dep
|
cairo_ft_dep = null_dep
|
||||||
if not get_option('cairo').disabled()
|
if not get_option('cairo').disabled()
|
||||||
cairo_dep = dependency('cairo', required: false)
|
cairo_dep = dependency('cairo', required: false)
|
||||||
|
cairo_ft_dep = dependency('cairo-ft', required: false)
|
||||||
|
|
||||||
if (not cairo_dep.found() and
|
if (not cairo_dep.found() and
|
||||||
cpp.get_id() == 'msvc' and
|
cpp.get_id() == 'msvc' and
|
||||||
cpp.has_header('cairo.h'))
|
cpp.has_header('cairo.h'))
|
||||||
cairo_dep = cpp.find_library('cairo', required: false)
|
cairo_dep = cpp.find_library('cairo', required: false)
|
||||||
|
if cairo_dep.found() and cpp.has_function('cairo_ft_font_face_create_for_ft_face',
|
||||||
|
prefix: '#include <cairo-ft.h>',
|
||||||
|
dependencies: cairo_dep)
|
||||||
|
cairo_ft_dep = cairo_dep
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if not cairo_dep.found()
|
if not cairo_dep.found()
|
||||||
# Note that we don't have harfbuzz -> cairo -> freetype2 -> harfbuzz fallback
|
# Requires Meson 0.54.0 to use cairo subproject
|
||||||
# dependency cycle here because we have configured freetype2 above with
|
if meson.version().version_compare('>=0.54.0')
|
||||||
# harfbuzz support disabled, so when cairo will lookup freetype2 dependency
|
# Note that we don't have harfbuzz -> cairo -> freetype2 -> harfbuzz fallback
|
||||||
# it will be forced to use that one.
|
# dependency cycle here because we have configured freetype2 above with
|
||||||
cairo_dep = dependency('cairo', fallback: ['cairo', 'libcairo_dep'],
|
# harfbuzz support disabled, so when cairo will lookup freetype2 dependency
|
||||||
required: get_option('cairo'))
|
# it will be forced to use that one.
|
||||||
endif
|
cairo_dep = dependency('cairo', fallback: 'cairo', required: get_option('cairo'))
|
||||||
|
cairo_ft_dep = dependency('cairo-ft', fallback: 'cairo', required: get_option('cairo'))
|
||||||
# Ensure that cairo-ft is fetched from the same library as cairo itself
|
elif get_option('cairo').enabled()
|
||||||
if cairo_dep.found()
|
error('cairo feature is enabled but it cannot be found on the system and ' +
|
||||||
if cairo_dep.type_name() == 'internal'
|
'meson>=0.54.0 is required to build it as subproject')
|
||||||
# It is true at least for the port we have
|
|
||||||
cairo_ft_dep = cairo_dep
|
|
||||||
elif (cairo_dep.type_name() == 'library' and
|
|
||||||
cpp.has_function('cairo_ft_font_face_create_for_ft_face',
|
|
||||||
prefix: '#include <cairo-ft.h>',
|
|
||||||
dependencies: cairo_dep))
|
|
||||||
cairo_ft_dep = cairo_dep
|
|
||||||
else # including the most important type for us, 'pkgconfig'
|
|
||||||
cairo_ft_dep = dependency('cairo-ft', required: get_option('cairo'))
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[wrap-git]
|
[wrap-git]
|
||||||
directory=cairo
|
directory=cairo
|
||||||
url=https://github.com/ebraminio/cairo.git
|
url=https://gitlab.freedesktop.org/cairo/cairo.git
|
||||||
depth=1
|
depth=1
|
||||||
revision=meson
|
revision=master
|
||||||
|
|
Loading…
Reference in New Issue