forked from thorvg/thorvg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson.build
133 lines (105 loc) · 3.62 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
project('thorvg',
'cpp',
default_options : ['buildtype=debugoptimized', 'b_sanitize=none', 'werror=false', 'optimization=s', 'cpp_std=c++14'],
version : '0.8.99',
license : 'MIT')
config_h = configuration_data()
src_dir = '/'.join(meson.current_source_dir().split('\\'))
add_project_arguments('-DEXAMPLE_DIR="@0@/src/examples/images"'.format(src_dir),
'-DTEST_DIR="@0@/test/images"'.format(src_dir),
language : 'cpp')
config_h.set_quoted('THORVG_VERSION_STRING', meson.project_version())
if get_option('engines').contains('sw') == true
config_h.set10('THORVG_SW_RASTER_SUPPORT', true)
endif
if get_option('engines').contains('gl') == true
config_h.set10('THORVG_GL_RASTER_SUPPORT', true)
endif
all_loaders = false
if get_option('loaders').contains('all') == true
all_loaders = true
endif
if all_loaders or get_option('loaders').contains('svg') == true
config_h.set10('THORVG_SVG_LOADER_SUPPORT', true)
endif
if all_loaders or get_option('loaders').contains('tvg') == true
config_h.set10('THORVG_TVG_LOADER_SUPPORT', true)
endif
if all_loaders or get_option('loaders').contains('png') == true
config_h.set10('THORVG_PNG_LOADER_SUPPORT', true)
endif
if all_loaders or get_option('loaders').contains('jpg') == true
config_h.set10('THORVG_JPG_LOADER_SUPPORT', true)
endif
if get_option('savers').contains('tvg') == true
config_h.set10('THORVG_TVG_SAVER_SUPPORT', true)
endif
simd_type = 'none'
if get_option('vector') == true
if host_machine.cpu_family() == 'x86' or host_machine.cpu_family() == 'x86_64'
config_h.set10('THORVG_AVX_VECTOR_SUPPORT', true)
simd_type = 'avx'
elif host_machine.cpu_family() == 'arm'
config_h.set10('THORVG_NEON_VECTOR_SUPPORT', true)
simd_type = 'neon'
endif
endif
if get_option('bindings').contains('capi') == true
config_h.set10('THORVG_CAPI_BINDING_SUPPORT', true)
endif
if get_option('log') == true
config_h.set10('THORVG_LOG_ENABLED', true)
endif
all_tools = false
if get_option('tools').contains('all') == true
all_tools = true
endif
configure_file(
output: 'config.h',
configuration: config_h
)
headers = [include_directories('inc'), include_directories('.')]
subdir('inc')
subdir('src')
if get_option('tests') == true
subdir('test')
endif
summary = '''
Summary:
ThorVG version: @0@
Build Type: @1@
Prefix: @2@
SIMD Instruction: @3@
Raster Engine (SW): @4@
Raster Engine (GL): @5@
Loader (TVG): @6@
Loader (SVG): @7@
Loader (PNG): @8@
Loader (JPG): @9@
Saver (TVG): @10@
CAPI Binding: @11@
Log Message: @12@
Tests: @13@
Examples: @14@
Tool (Svg2Tvg): @15@
Tool (Svg2Png): @16@
'''.format(
meson.project_version(),
get_option('buildtype'),
get_option('prefix'),
simd_type,
get_option('engines').contains('sw'),
get_option('engines').contains('gl'),
all_loaders or get_option('loaders').contains('tvg'),
all_loaders or get_option('loaders').contains('svg'),
all_loaders or get_option('loaders').contains('png'),
all_loaders or get_option('loaders').contains('jpg'),
get_option('savers').contains('tvg'),
get_option('bindings').contains('capi'),
get_option('log'),
get_option('tests'),
get_option('examples'),
all_tools or get_option('tools').contains('svg2tvg'),
all_tools or get_option('tools').contains('svg2png'),
)
message(summary)