meson: add option and build system plumbing for CoreText on macOS/iOS
Untested though.
This commit is contained in:
parent
83ebbe4ade
commit
4840c8237e
21
meson.build
21
meson.build
|
@ -146,6 +146,27 @@ if host_machine.system() == 'windows' and not get_option('directwrite').disabled
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# CoreText (macOS) - FIXME: untested
|
||||||
|
if host_machine.system() == 'darwin' and not get_option('coretext').disabled()
|
||||||
|
app_services_dep = dependency('appleframeworks', modules : ['ApplicationServices'], required: false)
|
||||||
|
if cpp.has_type('CTFontRef', prefix: '#include <ApplicationServices/ApplicationServices.h>', dependencies: app_services_dep)
|
||||||
|
deps += [app_services_dep]
|
||||||
|
conf.set('HAVE_CORETEXT', 1)
|
||||||
|
# On iOS CoreText and CoreGraphics are stand-alone frameworks
|
||||||
|
# Check for a different symbol to avoid getting cached result
|
||||||
|
else
|
||||||
|
coretext_dep = dependency('appleframeworks', modules : ['CoreText'], required: false)
|
||||||
|
coregraphics_dep = dependency('appleframeworks', modules : ['CoreGraphics'], required: false)
|
||||||
|
corefoundation_dep = dependency('appleframeworks', modules : ['CoreFoundation'], required: false)
|
||||||
|
if cpp.has_type('CTRunRef', prefix: '#include <CoreText/CoreText.h>', dependencies: [coretext_dep, coregraphics_dep, corefoundation_dep])
|
||||||
|
deps += [coretext_dep, coregraphics_dep, corefoundation_dep]
|
||||||
|
conf.set('HAVE_CORETEXT', 1)
|
||||||
|
elif get_option('coretext').enabled()
|
||||||
|
error('CoreText was enabled explicitly, but required headers or frameworks are missing.')
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
# threads
|
# threads
|
||||||
if host_machine.system() != 'windows'
|
if host_machine.system() != 'windows'
|
||||||
thread_dep = dependency('threads', required: false)
|
thread_dep = dependency('threads', required: false)
|
||||||
|
|
|
@ -19,6 +19,8 @@ option('uniscribe', type: 'feature', value: 'disabled',
|
||||||
description: 'Enable Uniscribe shaper backend (Windows only)')
|
description: 'Enable Uniscribe shaper backend (Windows only)')
|
||||||
option('directwrite', type: 'feature', value: 'disabled',
|
option('directwrite', type: 'feature', value: 'disabled',
|
||||||
description: 'Enable DirectWrite shaper backend on Windows (experimental)')
|
description: 'Enable DirectWrite shaper backend on Windows (experimental)')
|
||||||
|
option('coretext', type: 'feature', value: 'disabled',
|
||||||
|
description: 'Enable CoreText shaper backend on macOS')
|
||||||
|
|
||||||
# Common feature options
|
# Common feature options
|
||||||
#option('tests', type : 'feature', value : 'auto', yield : true,
|
#option('tests', type : 'feature', value : 'auto', yield : true,
|
||||||
|
|
|
@ -104,10 +104,6 @@ hb_graphite2_headers = [
|
||||||
'hb-graphite2.h',
|
'hb-graphite2.h',
|
||||||
]
|
]
|
||||||
|
|
||||||
hb_coretext_sources = [
|
|
||||||
'hb-coretext.cc',
|
|
||||||
]
|
|
||||||
|
|
||||||
hb_icu_sources = [
|
hb_icu_sources = [
|
||||||
'hb-icu.cc',
|
'hb-icu.cc',
|
||||||
]
|
]
|
||||||
|
@ -181,6 +177,11 @@ if conf.get('HAVE_DIRECTWRITE', 0) == 1
|
||||||
hb_headers += ['hb-directwrite.h']
|
hb_headers += ['hb-directwrite.h']
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if conf.get('HAVE_CORETEXT', 0) == 1
|
||||||
|
hb_sources += ['hb-coretext.cc']
|
||||||
|
hb_headers += ['hb-coretext.h']
|
||||||
|
endif
|
||||||
|
|
||||||
version = '0.' + '0'.join(meson.project_version().split('.')) + '.0'
|
version = '0.' + '0'.join(meson.project_version().split('.')) + '.0'
|
||||||
|
|
||||||
libharfbuzz = library('harfbuzz', hb_sources,
|
libharfbuzz = library('harfbuzz', hb_sources,
|
||||||
|
|
Loading…
Reference in New Issue