-
Notifications
You must be signed in to change notification settings - Fork 1
/
meson.build
128 lines (118 loc) · 2.78 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
project('wl-gl-samples', 'c')
dep_scanner = dependency('wayland-scanner', native: true)
prog_scanner = find_program(dep_scanner.get_pkgconfig_variable('wayland_scanner'))
dep_wp = dependency('wayland-protocols')
dir_wp_base = dep_wp.get_variable(pkgconfig: 'pkgdatadir')
xml_path = '@0@/stable/xdg-shell/xdg-shell.xml'.format(dir_wp_base)
xdg_shell_client_protocol_h = custom_target(
'xdg-shell-client-header',
input: xml_path,
output: 'xdg-shell-client-protocol.h',
command: [prog_scanner, 'client-header', '@INPUT@', '@OUTPUT@' ],
)
xdg_shell_protocol_c = custom_target(
'xdg-shell-protocol',
input: xml_path,
output: 'xdg-shell-protocol.c',
command: [ prog_scanner, 'private-code', '@INPUT@', '@OUTPUT@' ],
)
cc = meson.get_compiler('c')
dep_m = cc.find_library('m', required: true)
dep_egl = dependency('egl')
dep_gl = dependency('glesv2')
dep_wayland_egl = dependency('wayland-egl')
dep_wayland = dependency('wayland-client')
dep_wayland_cursor = dependency('wayland-cursor')
dep_cairo = dependency('cairo')
base_sources = [
xdg_shell_client_protocol_h,
xdg_shell_protocol_c,
'shader.c',
'common.c',
]
base_dep = [
dep_wayland,
dep_wayland_cursor,
dep_wayland_egl,
dep_egl,
dep_gl,
dep_m,
]
samples = [
{
'name': 'gl-cube',
'sources': [base_sources, 'cube.c'],
'dep': base_dep
},
{
'name': 'gl-bullet',
'sources': [base_sources, 'bullet.c'],
'dep': [base_dep, dep_cairo]
},
{
'name': 'gl-tex-cube',
'sources': [base_sources, 'tex-cube.c'],
'dep': [base_dep, dep_cairo]
},
{
'name': 'gl-fbo',
'sources': [base_sources, 'fbo.c'],
'dep': [base_dep, dep_cairo]
},
{
'name': 'gl-instanced-rendering1',
'sources': [base_sources, 'instanced_rendering1.c'],
'dep': [base_dep, dep_cairo]
},
{
'name': 'gl-instanced-rendering2',
'sources': [base_sources, 'instanced_rendering2.c'],
'dep': [base_dep, dep_cairo]
},
{
'name': 'gl-instanced-rendering3',
'sources': [base_sources, 'instanced_rendering3.c'],
'dep': [base_dep, dep_cairo]
},
{
'name': 'gl-transform-feedback1',
'sources': [base_sources, 'transform_feedback1.c'],
'dep': [base_dep, dep_cairo]
},
{
'name': 'gl-transform-feedback2',
'sources': [base_sources, 'transform_feedback2.c'],
'dep': [base_dep, dep_cairo]
},
{
'name': 'gl-compute1',
'sources': [base_sources, 'compute1.c'],
'dep': [base_dep]
},
{
'name': 'gl-compute2',
'sources': [base_sources, 'compute2.c'],
'dep': [base_dep],
},
{
'name': 'gl-compute3',
'sources': [base_sources, 'compute3.c'],
'dep': [base_dep, dep_cairo],
},
]
foreach s: samples
if get_option('debug-log') == true
executable(
s.get('name'),
s.get('sources'),
c_args: '-DDEBUG',
dependencies: s.get('dep')
)
else
executable(
s.get('name'),
s.get('sources'),
dependencies: s.get('dep')
)
endif
endforeach