blob: 610ced9fc7232d840659018192d7750815d05dde [file] [log] [blame]
Mathieu Duponchelle920efc02018-05-17 01:28:53 +02001project('harfbuzz', 'c', 'cpp',
Ebrahim Byagowi6e321452020-08-13 00:13:06 +04302 meson_version: '>= 0.47.0',
Ebrahim Byagowia01c7a32020-07-25 12:27:31 +04303 version: '2.7.0',
Ebrahim Byagowiddb103e2020-07-06 22:27:39 +04304 default_options: [
Ebrahim Byagowi97079a72020-08-02 12:34:21 +04305 'cpp_eh=none', # Just to support msvc, we are passing -fno-rtti also anyway
6 'cpp_rtti=false', # Just to support msvc, we are passing -fno-exceptions also anyway
Ebrahim Byagowiddb103e2020-07-06 22:27:39 +04307 'cpp_std=c++11',
Ebrahim Byagowi34a05322020-08-04 15:14:59 +04308 'wrap_mode=nofallback', # Use --wrap-mode=default to revert, https://github.com/harfbuzz/harfbuzz/pull/2548
Ebrahim Byagowiddb103e2020-07-06 22:27:39 +04309 ],
Ebrahim Byagowia08ba462020-07-06 00:31:42 +043010)
Mathieu Duponchelle920efc02018-05-17 01:28:53 +020011
Tim-Philipp Müller535186f2018-12-03 20:51:06 +010012hb_version_arr = meson.project_version().split('.')
13hb_version_major = hb_version_arr[0].to_int()
14hb_version_minor = hb_version_arr[1].to_int()
15hb_version_micro = hb_version_arr[2].to_int()
16
17# libtool versioning
18hb_version_int = hb_version_major*10000 + hb_version_minor*100 + hb_version_micro
Ebrahim Byagowief2e3802020-08-12 00:50:33 +043019hb_libtool_version_info = '@0@:0:@0@'.format(hb_version_int)
Tim-Philipp Müller535186f2018-12-03 20:51:06 +010020
Mathieu Duponchelle484313f2018-06-05 02:15:43 +020021pkgmod = import('pkgconfig')
Mathieu Duponchelle920efc02018-05-17 01:28:53 +020022cpp = meson.get_compiler('cpp')
Ebrahim Byagowif2a80ab2020-07-03 04:28:08 +043023null_dep = dependency('', required: false)
Mathieu Duponchelle920efc02018-05-17 01:28:53 +020024
Tim-Philipp Müller4a47f1a2018-12-01 11:05:27 +000025if cpp.get_id() == 'msvc'
26 # Ignore several spurious warnings for things HarfBuzz does very commonly.
27 # If a warning is completely useless and spammy, use '/wdXXXX' to suppress it
28 # If a warning is harmless but hard to fix, use '/woXXXX' so it's shown once
29 # NOTE: Only add warnings here if you are sure they're spurious
30 msvc_args = [
Ebrahim Byagowiddb103e2020-07-06 22:27:39 +043031 '/wd4018', # implicit signed/unsigned conversion
32 '/wd4146', # unary minus on unsigned (beware INT_MIN)
33 '/wd4244', # lossy type conversion (e.g. double -> int)
34 '/wd4305', # truncating type conversion (e.g. double -> float)
35 cpp.get_supported_arguments(['/utf-8']), # set the input encoding to utf-8
Tim-Philipp Müller4a47f1a2018-12-01 11:05:27 +000036 ]
Ebrahim Byagowi62de2f72020-06-11 19:09:24 +043037 add_project_arguments(msvc_args, language: ['c', 'cpp'])
Tim-Philipp Müller4a47f1a2018-12-01 11:05:27 +000038 # Disable SAFESEH with MSVC for libs that use external deps that are built with MinGW
39 # noseh_link_args = ['/SAFESEH:NO']
40endif
41
Ebrahim Byagowi22048d52020-06-05 04:09:07 +043042add_project_link_arguments(cpp.get_supported_link_arguments([
43 '-Bsymbolic-functions'
Ebrahim Byagowi62de2f72020-06-11 19:09:24 +043044]), language: 'c')
Ebrahim Byagowi22048d52020-06-05 04:09:07 +043045
Tim-Philipp Müllerbb8aaa32020-03-14 01:05:38 +000046add_project_arguments(cpp.get_supported_arguments([
Ebrahim Byagowi365d2d32020-03-11 20:16:36 +033047 '-fno-exceptions',
Ebrahim Byagowi97079a72020-08-02 12:34:21 +043048 '-fno-rtti',
Ebrahim Byagowi365d2d32020-03-11 20:16:36 +033049 '-fno-threadsafe-statics',
Ebrahim Byagowi749e2752020-08-02 12:21:51 +043050 '-fvisibility-inlines-hidden',
Ebrahim Byagowi62de2f72020-06-11 19:09:24 +043051]), language: 'cpp')
Ebrahim Byagowi365d2d32020-03-11 20:16:36 +033052
53if host_machine.cpu_family() == 'arm' and cpp.alignment('struct { char c; }') != 1
54 if cpp.has_argument('-mstructure-size-boundary=8')
Ebrahim Byagowi62de2f72020-06-11 19:09:24 +043055 add_project_arguments('-mstructure-size-boundary=8', language: 'cpp')
Ebrahim Byagowi365d2d32020-03-11 20:16:36 +033056 endif
57endif
58
Mathieu Duponchelle920efc02018-05-17 01:28:53 +020059check_headers = [
60 ['unistd.h'],
61 ['sys/mman.h'],
Mathieu Duponchelle920efc02018-05-17 01:28:53 +020062 ['stdbool.h'],
63]
64
65check_funcs = [
66 ['atexit'],
67 ['mprotect'],
68 ['sysconf'],
69 ['getpagesize'],
70 ['mmap'],
71 ['isatty'],
Mathieu Duponchelle920efc02018-05-17 01:28:53 +020072]
73
Ebrahim Byagowib8454c32020-06-11 18:32:13 +043074m_dep = cpp.find_library('m', required: false)
75
Ebrahim Byagowi42d039c2020-07-03 04:32:32 +043076freetype_dep = null_dep
Ebrahim Byagowiebab4b82020-06-10 16:52:32 +043077if not get_option('freetype').disabled()
78 freetype_dep = dependency('freetype2', required: false)
Ebrahim Byagowib8454c32020-06-11 18:32:13 +043079
Ebrahim Byagowi24b42002020-08-13 09:06:39 +043080 if (not freetype_dep.found() and
81 cpp.get_id() == 'msvc' and
82 cpp.has_header('ft2build.h'))
83 freetype_dep = cpp.find_library('freetype', required: false)
Ebrahim Byagowib8454c32020-06-11 18:32:13 +043084 endif
85
Xavier Claessensc4bbe892020-06-24 13:40:55 -040086 if not freetype_dep.found()
Ebrahim Byagowi020b1822020-07-01 14:22:46 +043087 # https://github.com/harfbuzz/harfbuzz/pull/2498
88 freetype_dep = dependency('freetype2', required: get_option('freetype'),
89 fallback: ['freetype2', 'freetype_dep'],
90 default_options: ['harfbuzz=disabled'])
Ebrahim Byagowib8454c32020-06-11 18:32:13 +043091 endif
Ebrahim Byagowiebab4b82020-06-10 16:52:32 +043092endif
Chun-wei Fan733414b2020-03-13 16:15:21 +080093
Tim-Philipp Müller49ba2112018-11-12 15:36:27 +000094glib_dep = dependency('glib-2.0', required: get_option('glib'),
Nirbheek Chauhanf65def42018-10-12 19:41:49 +053095 fallback: ['glib', 'libglib_dep'])
Tim-Philipp Müller49ba2112018-11-12 15:36:27 +000096gobject_dep = dependency('gobject-2.0', required: get_option('gobject'),
Nirbheek Chauhanf65def42018-10-12 19:41:49 +053097 fallback: ['glib', 'libgobject_dep'])
Tim-Philipp Müller49ba2112018-11-12 15:36:27 +000098fontconfig_dep = dependency('fontconfig', required: get_option('fontconfig'),
Nirbheek Chauhanf65def42018-10-12 19:41:49 +053099 fallback: ['fontconfig', 'fontconfig_dep'])
Tim-Philipp Müller49ba2112018-11-12 15:36:27 +0000100graphite2_dep = dependency('graphite2', required: get_option('graphite'))
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200101
Ebrahim Byagowi42d039c2020-07-03 04:32:32 +0430102icu_dep = null_dep
Ebrahim Byagowiebab4b82020-06-10 16:52:32 +0430103if not get_option('icu').disabled()
104 icu_dep = dependency('icu-uc', required: false)
Ebrahim Byagowib8454c32020-06-11 18:32:13 +0430105
Ebrahim Byagowi24b42002020-08-13 09:06:39 +0430106 if (not icu_dep.found() and
107 cpp.get_id() == 'msvc' and
108 cpp.has_header('unicode/uchar.h') and
109 cpp.has_header('unicode/unorm2.h') and
110 cpp.has_header('unicode/ustring.h') and
111 cpp.has_header('unicode/utf16.h') and
112 cpp.has_header('unicode/uversion.h') and
113 cpp.has_header('unicode/uscript.h'))
114 if get_option('buildtype') == 'debug'
115 icu_dep = cpp.find_library('icuucd', required: false)
116 else
117 icu_dep = cpp.find_library('icuuc', required: false)
118 endif
Ebrahim Byagowib8454c32020-06-11 18:32:13 +0430119 endif
120
Ebrahim Byagowi24b42002020-08-13 09:06:39 +0430121 if not icu_dep.found()
122 icu_dep = dependency('icu-uc', required: get_option('icu'))
Chun-wei Fan5efce602020-03-13 16:40:20 +0800123 endif
124endif
125
Ebrahim Byagowi42d039c2020-07-03 04:32:32 +0430126cairo_dep = null_dep
127cairo_ft_dep = null_dep
Ebrahim Byagowiebab4b82020-06-10 16:52:32 +0430128if not get_option('cairo').disabled()
129 cairo_dep = dependency('cairo', required: false)
Chun-wei Fan9d0e6ae2020-03-13 16:56:55 +0800130
Ebrahim Byagowi24b42002020-08-13 09:06:39 +0430131 if (not cairo_dep.found() and
132 cpp.get_id() == 'msvc' and
133 cpp.has_header('cairo.h'))
134 cairo_dep = cpp.find_library('cairo', required: false)
Nirbheek Chauhanf65def42018-10-12 19:41:49 +0530135 endif
Ebrahim Byagowib8454c32020-06-11 18:32:13 +0430136
Xavier Claessens00c652a2020-06-24 14:11:32 -0400137 if not cairo_dep.found()
138 # Note that we don't have harfbuzz -> cairo -> freetype2 -> harfbuzz fallback
139 # dependency cycle here because we have configured freetype2 above with
140 # harfbuzz support disabled, so when cairo will lookup freetype2 dependency
141 # it will be forced to use that one.
Xavier Claessens01fa55e2020-06-24 15:56:09 -0400142 cairo_dep = dependency('cairo', fallback: ['cairo', 'libcairo_dep'],
143 required: get_option('cairo'))
Ebrahim Byagowib8454c32020-06-11 18:32:13 +0430144 endif
145
146 # Ensure that cairo-ft is fetched from the same library as cairo itself
147 if cairo_dep.found()
Ebrahim Byagowi05ab0732020-07-02 23:54:09 +0430148 if cairo_dep.type_name() == 'internal'
149 # It is true at least for the port we have
150 cairo_ft_dep = cairo_dep
Ebrahim Byagowi58209c82020-08-12 23:04:26 +0430151 elif (cairo_dep.type_name() == 'library' and
152 cpp.has_function('cairo_ft_font_face_create_for_ft_face',
153 prefix: '#include <cairo-ft.h>',
154 dependencies: cairo_dep))
Ebrahim Byagowi05ab0732020-07-02 23:54:09 +0430155 cairo_ft_dep = cairo_dep
156 else # including the most important type for us, 'pkgconfig'
Ebrahim Byagowib8454c32020-06-11 18:32:13 +0430157 cairo_ft_dep = dependency('cairo-ft', required: get_option('cairo'))
Ebrahim Byagowib8454c32020-06-11 18:32:13 +0430158 endif
Ebrahim Byagowib8454c32020-06-11 18:32:13 +0430159 endif
Nirbheek Chauhanf65def42018-10-12 19:41:49 +0530160endif
161
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200162conf = configuration_data()
Tim-Philipp Müller618584e2018-11-14 20:19:36 +0000163incconfig = include_directories('.')
Tim-Philipp Müllera3892be2020-03-14 01:08:15 +0000164
165add_project_arguments('-DHAVE_CONFIG_H', language: ['c', 'cpp'])
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200166
167warn_cflags = [
168 '-Wno-non-virtual-dtor',
169]
170
Tim-Philipp Müllera3892be2020-03-14 01:08:15 +0000171cpp_args = cpp.get_supported_arguments(warn_cflags)
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200172
173if glib_dep.found()
174 conf.set('HAVE_GLIB', 1)
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200175endif
176
177if gobject_dep.found()
178 conf.set('HAVE_GOBJECT', 1)
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200179endif
180
181if cairo_dep.found()
182 conf.set('HAVE_CAIRO', 1)
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200183endif
184
185if cairo_ft_dep.found()
186 conf.set('HAVE_CAIRO_FT', 1)
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200187endif
188
189if graphite2_dep.found()
190 conf.set('HAVE_GRAPHITE2', 1)
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200191endif
192
193if icu_dep.found()
194 conf.set('HAVE_ICU', 1)
Ebrahim Byagowic6b3f732020-04-19 00:54:24 +0430195endif
196
Ebrahim Byagowicc53fd12020-05-21 19:33:18 +0430197if get_option('icu_builtin')
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200198 conf.set('HAVE_ICU_BUILTIN', 1)
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200199endif
200
Ebrahim Byagowicc53fd12020-05-21 19:33:18 +0430201if get_option('experimental_api')
Ebrahim Byagowi750bb732020-04-21 01:13:13 +0430202 conf.set('HB_EXPERIMENTAL_API', 1)
203endif
204
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200205if freetype_dep.found()
206 conf.set('HAVE_FREETYPE', 1)
Mathieu Duponchelle04bcdb92018-06-05 20:59:29 +0200207 check_freetype_funcs = [
208 ['FT_Get_Var_Blend_Coordinates', {'deps': freetype_dep}],
209 ['FT_Set_Var_Blend_Coordinates', {'deps': freetype_dep}],
210 ['FT_Done_MM_Var', {'deps': freetype_dep}],
211 ]
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200212
213 if freetype_dep.type_name() == 'internal'
214 foreach func: check_freetype_funcs
215 name = func[0]
216 conf.set('HAVE_@0@'.format(name.to_upper()), 1)
217 endforeach
218 else
219 check_funcs += check_freetype_funcs
220 endif
221endif
222
223if fontconfig_dep.found()
224 conf.set('HAVE_FONTCONFIG', 1)
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200225endif
226
Christoph Reiter03bd6ea2020-06-03 23:52:10 +0200227gdi_uniscribe_deps = []
Ebrahim Byagowiddb103e2020-07-06 22:27:39 +0430228# GDI (Uniscribe) (Windows)
Chun-wei Fan838346c2020-03-13 18:01:17 +0800229if host_machine.system() == 'windows' and not get_option('gdi').disabled()
Ebrahim Byagowi24b42002020-08-13 09:06:39 +0430230 gdi_deps_found = cpp.has_header('usp10.h') and cpp.has_header('windows.h')
Ebrahim Byagowif62f4e32020-07-08 00:26:40 +0430231
232 foreach usplib : ['usp10', 'gdi32', 'rpcrt4']
Ebrahim Byagowi24b42002020-08-13 09:06:39 +0430233 dep = cpp.find_library(usplib, required: get_option('gdi'))
Ebrahim Byagowif62f4e32020-07-08 00:26:40 +0430234 gdi_deps_found = gdi_deps_found and dep.found()
235 gdi_uniscribe_deps += dep
236 endforeach
237
238 if gdi_deps_found
Tim-Philipp Müllerb7796a52018-11-12 16:56:56 +0000239 conf.set('HAVE_UNISCRIBE', 1)
Chun-wei Fan838346c2020-03-13 18:01:17 +0800240 conf.set('HAVE_GDI', 1)
Tim-Philipp Müllerb7796a52018-11-12 16:56:56 +0000241 endif
242endif
243
Ebrahim Byagowiddb103e2020-07-06 22:27:39 +0430244# DirectWrite (Windows)
Ebrahim Byagowif2a80ab2020-07-03 04:28:08 +0430245directwrite_dep = null_dep
Tim-Philipp Müller83ebbe42018-11-12 16:56:56 +0000246if host_machine.system() == 'windows' and not get_option('directwrite').disabled()
Ebrahim Byagowi24b42002020-08-13 09:06:39 +0430247 if get_option('directwrite').enabled() and not cpp.has_header('dwrite_1.h')
248 error('DirectWrite was enabled explicitly, but required header is missing.')
249 endif
250
251 directwrite_dep = cpp.find_library('dwrite', required: get_option('directwrite'))
Ebrahim Byagowif62f4e32020-07-08 00:26:40 +0430252
253 if directwrite_dep.found()
Tim-Philipp Müller83ebbe42018-11-12 16:56:56 +0000254 conf.set('HAVE_DIRECTWRITE', 1)
Tim-Philipp Müller83ebbe42018-11-12 16:56:56 +0000255 endif
256endif
257
Ebrahim Byagowi52199342020-07-06 16:30:59 +0430258# CoreText (macOS)
Christoph Reiter03bd6ea2020-06-03 23:52:10 +0200259coretext_deps = []
Tim-Philipp Müller4840c822018-11-12 16:56:56 +0000260if host_machine.system() == 'darwin' and not get_option('coretext').disabled()
Ebrahim Byagowi62de2f72020-06-11 19:09:24 +0430261 app_services_dep = dependency('appleframeworks', modules: ['ApplicationServices'], required: false)
Tim-Philipp Müller4840c822018-11-12 16:56:56 +0000262 if cpp.has_type('CTFontRef', prefix: '#include <ApplicationServices/ApplicationServices.h>', dependencies: app_services_dep)
Christoph Reiter03bd6ea2020-06-03 23:52:10 +0200263 coretext_deps += [app_services_dep]
Tim-Philipp Müller4840c822018-11-12 16:56:56 +0000264 conf.set('HAVE_CORETEXT', 1)
265 # On iOS CoreText and CoreGraphics are stand-alone frameworks
266 # Check for a different symbol to avoid getting cached result
267 else
Ebrahim Byagowi62de2f72020-06-11 19:09:24 +0430268 coretext_dep = dependency('appleframeworks', modules: ['CoreText'], required: false)
269 coregraphics_dep = dependency('appleframeworks', modules: ['CoreGraphics'], required: false)
270 corefoundation_dep = dependency('appleframeworks', modules: ['CoreFoundation'], required: false)
Tim-Philipp Müller4840c822018-11-12 16:56:56 +0000271 if cpp.has_type('CTRunRef', prefix: '#include <CoreText/CoreText.h>', dependencies: [coretext_dep, coregraphics_dep, corefoundation_dep])
Christoph Reiter03bd6ea2020-06-03 23:52:10 +0200272 coretext_deps += [coretext_dep, coregraphics_dep, corefoundation_dep]
Tim-Philipp Müller4840c822018-11-12 16:56:56 +0000273 conf.set('HAVE_CORETEXT', 1)
274 elif get_option('coretext').enabled()
275 error('CoreText was enabled explicitly, but required headers or frameworks are missing.')
276 endif
277 endif
278endif
279
Tim-Philipp Müllerb7796a52018-11-12 16:56:56 +0000280# threads
Ebrahim Byagowif2a80ab2020-07-03 04:28:08 +0430281thread_dep = null_dep
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200282if host_machine.system() != 'windows'
283 thread_dep = dependency('threads', required: false)
284
285 if thread_dep.found()
286 conf.set('HAVE_PTHREAD', 1)
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200287 else
288 check_headers += ['sched.h']
289 check_funcs += ['sched_yield', {'link_with': 'rt'}]
290 endif
291endif
292
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200293conf.set_quoted('PACKAGE_NAME', 'HarfBuzz')
294conf.set_quoted('PACKAGE_VERSION', meson.project_version())
295
296foreach check : check_headers
297 name = check[0]
298
299 if cpp.has_header(name)
300 conf.set('HAVE_@0@'.format(name.to_upper().underscorify()), 1)
301 endif
302endforeach
303
Christoph Reiter03bd6ea2020-06-03 23:52:10 +0200304harfbuzz_extra_deps = []
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200305foreach check : check_funcs
306 name = check[0]
Mathieu Duponchelle04bcdb92018-06-05 20:59:29 +0200307 opts = check.get(1, {})
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200308 link_withs = opts.get('link_with', [])
Mathieu Duponchelle04bcdb92018-06-05 20:59:29 +0200309 check_deps = opts.get('deps', [])
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200310 extra_deps = []
311 found = true
312
313 # First try without linking
Mathieu Duponchelle04bcdb92018-06-05 20:59:29 +0200314 found = cpp.has_function(name, dependencies: check_deps)
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200315
316 if not found and link_withs.length() > 0
317 found = true
318
319 foreach link_with : link_withs
320 dep = cpp.find_library(link_with, required: false)
321 if dep.found()
Ebrahim Byagowie8808c12020-03-24 19:15:09 +0430322 extra_deps += dep
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200323 else
Ebrahim Byagowie8808c12020-03-24 19:15:09 +0430324 found = false
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200325 endif
326 endforeach
327
328 if found
Mathieu Duponchelle04bcdb92018-06-05 20:59:29 +0200329 found = cpp.has_function(name, dependencies: check_deps + extra_deps)
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200330 endif
331 endif
332
333 if found
Christoph Reiter03bd6ea2020-06-03 23:52:10 +0200334 harfbuzz_extra_deps += extra_deps
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200335 conf.set('HAVE_@0@'.format(name.to_upper()), 1)
336 endif
337endforeach
338
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200339if cpp.links(files('meson-cc-tests/intel-atomic-primitives-test.c'), name: 'Intel atomics')
340 conf.set('HAVE_INTEL_ATOMIC_PRIMITIVES', 1)
341endif
342
343if cpp.links(files('meson-cc-tests/solaris-atomic-operations.c'), name: 'Solaris atomic ops')
344 conf.set('HAVE_SOLARIS_ATOMIC_OPS', 1)
345endif
346
347subdir('src')
348subdir('util')
Tim-Philipp Müller6147df32018-11-14 10:12:40 +0000349
350if not get_option('tests').disabled()
351 subdir('test')
352endif
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200353
Ebrahim Byagowi6e321452020-08-13 00:13:06 +0430354# get_option('wrap_mode') isn't available in <0.49 and this
355# is just an internal tool
356if meson.version().version_compare('>=0.49')
357 if (not get_option('benchmark').disabled() and
358 get_option('wrap_mode') != 'nodownload' and
359 host_machine.system() != 'windows' and
360 not meson.is_subproject() and
361 not meson.is_cross_build())
362 subdir('perf')
363 endif
Ebrahim Byagowi95b10812020-06-09 17:37:36 +0430364endif
365
Ebrahim Byagowif9ac6dd2020-07-22 17:53:04 +0430366if not get_option('docs').disabled()
Tim-Philipp Müller3dd7b212020-05-17 00:12:08 +0100367 subdir('docs')
368endif
369
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200370configure_file(output: 'config.h', configuration: conf)
Ebrahim Byagowia9e83282020-05-21 16:28:24 +0430371
Ebrahim Byagowi58209c82020-08-12 23:04:26 +0430372build_summary = {
373 'Directories':
374 {'prefix': get_option('prefix'),
375 'bindir': get_option('bindir'),
376 'libdir': get_option('libdir'),
377 'includedir': get_option('includedir'),
378 'datadir': get_option('datadir'),
379 },
380 'Unicode callbacks (you want at least one)':
381 {'Builtin': true,
382 'Glib': conf.get('HAVE_GLIB', 0) == 1,
383 'ICU': conf.get('HAVE_ICU', 0) == 1,
384 },
385 'Font callbacks (the more the merrier)':
386 {'FreeType': conf.get('HAVE_FREETYPE', 0) == 1,
387 },
388 'Dependencies used for command-line utilities':
389 {'Cairo': conf.get('HAVE_CAIRO', 0) == 1,
390 'Fontconfig': conf.get('HAVE_FONTCONFIG', 0) == 1,
391 },
392 'Additional shapers':
393 {'Graphite2': conf.get('HAVE_GRAPHITE2', 0) == 1,
394 },
395 'Platform shapers (not normally needed)':
396 {'CoreText': conf.get('HAVE_CORETEXT', 0) == 1,
397 'DirectWrite': conf.get('HAVE_DIRECTWRITE', 0) == 1,
398 'GDI/Uniscribe': (conf.get('HAVE_GDI', 0) == 1) and (conf.get('HAVE_UNISCRIBE', 0) == 1),
399 },
400 'Other features':
401 {'Documentation': conf.get('HAVE_GTK_DOC', 0) == 1,
402 'GObject bindings': conf.get('HAVE_GOBJECT', 0) == 1,
403 'Introspection': conf.get('HAVE_INTROSPECTION', 0) == 1,
404 },
405}
406if meson.version().version_compare('>=0.53')
407 foreach section_title, section : build_summary
408 summary(section, bool_yn: true, section: section_title)
409 endforeach
410else
411 summary = ['']
412 foreach section_title, section : build_summary
413 summary += ' @0@:'.format(section_title)
414 foreach feature, value : section
415 summary += ' @0@:'.format(feature)
416 summary += ' @0@'.format(value)
417 endforeach
418 summary += ''
419 endforeach
420 message('\n'.join(summary))
421endif