forked from sammycage/plutosvg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson.build
72 lines (60 loc) · 1.85 KB
/
meson.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
project('plutosvg', 'c',
version: '0.0.3',
license: 'MIT',
meson_version: '>=0.64.0',
default_options: ['c_std=c99']
)
plutosvg_deps = []
plutosvg_compile_args = []
plutovg_dep = dependency('plutovg',
required: true,
version: '>=0.0.3',
fallback: ['plutovg', 'plutovg_dep']
)
plutosvg_deps += [plutovg_dep]
cc = meson.get_compiler('c')
math_dep = cc.find_library('m', required: false)
if math_dep.found()
plutosvg_deps += [math_dep]
endif
freetype_dep = dependency('freetype2',
required: get_option('freetype'),
version: '>=2.12',
allow_fallback: false
)
if freetype_dep.found() and cc.has_type('SVG_RendererHooks', dependencies: freetype_dep, prefix: '#include <freetype/otsvg.h>')
plutosvg_deps += [freetype_dep]
plutosvg_compile_args += ['-DPLUTOSVG_HAS_FREETYPE']
else
freetype_dep = disabler()
endif
if get_option('default_library') == 'static'
plutosvg_compile_args += ['-DPLUTOSVG_BUILD_STATIC']
endif
plutosvg_lib = library('plutosvg', 'source/plutosvg.c',
include_directories: include_directories('source'),
dependencies: plutosvg_deps,
version: meson.project_version(),
c_args: ['-DPLUTOSVG_BUILD'] + plutosvg_compile_args,
cpp_args: ['-DPLUTOSVG_BUILD'] + plutosvg_compile_args,
gnu_symbol_visibility: 'hidden',
install: true
)
plutosvg_dep = declare_dependency(
link_with: plutosvg_lib,
dependencies: plutovg_dep,
include_directories: include_directories('source'),
compile_args: plutosvg_compile_args
)
meson.override_dependency('plutosvg', plutosvg_dep)
install_headers('source/plutosvg.h', subdir: 'plutosvg')
if not get_option('examples').disabled()
subdir('examples')
endif
pkgmod = import('pkgconfig')
pkgmod.generate(plutosvg_lib,
name: 'PlutoSVG',
description: 'Tiny SVG rendering library',
filebase: 'plutosvg',
subdirs: 'plutosvg'
)