[meson] use if blocks to separate different dependencies
This commit is contained in:
parent
8571b3551c
commit
b8454c3d61
110
meson.build
110
meson.build
@ -74,19 +74,23 @@ check_funcs = [
|
|||||||
['roundf'],
|
['roundf'],
|
||||||
]
|
]
|
||||||
|
|
||||||
|
m_dep = cpp.find_library('m', required: false)
|
||||||
|
|
||||||
if not get_option('freetype').disabled()
|
if not get_option('freetype').disabled()
|
||||||
freetype_dep = dependency('freetype2', required: false)
|
freetype_dep = dependency('freetype2', required: false)
|
||||||
|
|
||||||
|
if not freetype_dep.found() and cpp.get_id() == 'msvc'
|
||||||
|
if cpp.has_header('ft2build.h')
|
||||||
|
freetype_dep = cpp.find_library('freetype', required: false)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
if not freetype_dep.found() and get_option('freetype').enabled()
|
||||||
|
freetype_dep = dependency('freetype2', fallback: ['freetype2', 'freetype_dep'])
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
freetype_dep = dependency('', required: false)
|
freetype_dep = dependency('', required: false)
|
||||||
endif
|
endif
|
||||||
if not get_option('freetype').disabled() and not freetype_dep.found() and cpp.get_id() == 'msvc'
|
|
||||||
if cpp.has_header('ft2build.h')
|
|
||||||
freetype_dep = cpp.find_library('freetype', required: false)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
if not freetype_dep.found() and get_option('freetype').enabled()
|
|
||||||
freetype_dep = dependency('freetype2', fallback: ['freetype2', 'freetype_dep'])
|
|
||||||
endif
|
|
||||||
|
|
||||||
glib_dep = dependency('glib-2.0', required: get_option('glib'),
|
glib_dep = dependency('glib-2.0', required: get_option('glib'),
|
||||||
fallback: ['glib', 'libglib_dep'])
|
fallback: ['glib', 'libglib_dep'])
|
||||||
@ -95,64 +99,66 @@ gobject_dep = dependency('gobject-2.0', required: get_option('gobject'),
|
|||||||
fontconfig_dep = dependency('fontconfig', required: get_option('fontconfig'),
|
fontconfig_dep = dependency('fontconfig', required: get_option('fontconfig'),
|
||||||
fallback: ['fontconfig', 'fontconfig_dep'])
|
fallback: ['fontconfig', 'fontconfig_dep'])
|
||||||
graphite2_dep = dependency('graphite2', required: get_option('graphite'))
|
graphite2_dep = dependency('graphite2', required: get_option('graphite'))
|
||||||
m_dep = cpp.find_library('m', required: false)
|
|
||||||
|
|
||||||
if not get_option('icu').disabled()
|
if not get_option('icu').disabled()
|
||||||
icu_dep = dependency('icu-uc', required: false)
|
icu_dep = dependency('icu-uc', required: false)
|
||||||
else
|
|
||||||
icu_dep = dependency('', required: false)
|
if not icu_dep.found() and get_option('icu').enabled()
|
||||||
endif
|
icu_dep = dependency('icu-uc', required: cpp.get_id() != 'msvc')
|
||||||
if not icu_dep.found() and get_option('icu').enabled()
|
endif
|
||||||
icu_dep = dependency('icu-uc', required: cpp.get_id() != 'msvc')
|
|
||||||
endif
|
if not icu_dep.found() and cpp.get_id() == 'msvc'
|
||||||
if not get_option('icu').disabled() and not icu_dep.found() and cpp.get_id() == 'msvc'
|
if cpp.has_header('unicode/uchar.h') and \
|
||||||
if cpp.has_header('unicode/uchar.h') and \
|
cpp.has_header('unicode/unorm2.h') and \
|
||||||
cpp.has_header('unicode/unorm2.h') and \
|
cpp.has_header('unicode/ustring.h') and \
|
||||||
cpp.has_header('unicode/ustring.h') and \
|
cpp.has_header('unicode/utf16.h') and \
|
||||||
cpp.has_header('unicode/utf16.h') and \
|
cpp.has_header('unicode/uversion.h') and \
|
||||||
cpp.has_header('unicode/uversion.h') and \
|
cpp.has_header('unicode/uscript.h')
|
||||||
cpp.has_header('unicode/uscript.h')
|
if get_option('buildtype') == 'debug'
|
||||||
if get_option('buildtype') == 'debug'
|
icu_dep = cpp.find_library('icuucd', required: get_option('icu'))
|
||||||
icu_dep = cpp.find_library('icuucd', required: get_option('icu'))
|
else
|
||||||
|
icu_dep = cpp.find_library('icuuc', required: get_option('icu'))
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
icu_dep = cpp.find_library('icuuc', required: get_option('icu'))
|
if get_option('icu').enabled()
|
||||||
endif
|
error('ICU headers and libraries must be present to build ICU support')
|
||||||
else
|
endif
|
||||||
if get_option('icu').enabled()
|
|
||||||
error('ICU headers and libraries must be present to build ICU support')
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
else
|
||||||
|
icu_dep = dependency('', required: false)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if not get_option('cairo').disabled()
|
if not get_option('cairo').disabled()
|
||||||
cairo_dep = dependency('cairo', required: false)
|
cairo_dep = dependency('cairo', required: false)
|
||||||
else
|
|
||||||
cairo_dep = dependency('', required: false)
|
|
||||||
endif
|
|
||||||
if not get_option('cairo').disabled() and not cairo_dep.found() and cpp.get_id() == 'msvc'
|
|
||||||
if cpp.has_header('cairo.h')
|
|
||||||
cairo_dep = cpp.find_library('cairo')
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
if not cairo_dep.found() and get_option('cairo').enabled()
|
|
||||||
cairo_dep = dependency('cairo', fallback: ['cairo', 'libcairo_dep'])
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Ensure that cairo-ft is fetched from the same library as cairo itself
|
if not cairo_dep.found() and cpp.get_id() == 'msvc'
|
||||||
if cairo_dep.found()
|
if cpp.has_header('cairo.h')
|
||||||
if cairo_dep.type_name() == 'pkgconfig'
|
cairo_dep = cpp.find_library('cairo')
|
||||||
cairo_ft_dep = dependency('cairo-ft', required: get_option('cairo'))
|
|
||||||
else
|
|
||||||
if cpp.has_header('cairo-ft.h') and \
|
|
||||||
cpp.has_function('cairo_ft_font_face_create_for_ft_face', dependencies: cairo_dep)
|
|
||||||
cairo_ft_dep = cairo_dep
|
|
||||||
else
|
|
||||||
# Not-found dependency
|
|
||||||
cairo_ft_dep = dependency('', required: false)
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if not cairo_dep.found() and get_option('cairo').enabled()
|
||||||
|
cairo_dep = dependency('cairo', fallback: ['cairo', 'libcairo_dep'])
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Ensure that cairo-ft is fetched from the same library as cairo itself
|
||||||
|
if cairo_dep.found()
|
||||||
|
if cairo_dep.type_name() == 'pkgconfig'
|
||||||
|
cairo_ft_dep = dependency('cairo-ft', required: get_option('cairo'))
|
||||||
|
else
|
||||||
|
if cpp.has_header('cairo-ft.h') and \
|
||||||
|
cpp.has_function('cairo_ft_font_face_create_for_ft_face', dependencies: cairo_dep)
|
||||||
|
cairo_ft_dep = cairo_dep
|
||||||
|
else
|
||||||
|
cairo_ft_dep = dependency('', required: false)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
cairo_ft_dep = dependency('', required: false)
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
# Not-found dependency
|
cairo_dep = dependency('', required: false)
|
||||||
cairo_ft_dep = dependency('', required: false)
|
cairo_ft_dep = dependency('', required: false)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user