aboutsummaryrefslogtreecommitdiff
path: root/examples/meson.build
blob: 3fe07df8e9bad495ad07069be93eb511d50c0076 (plain)
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
cairo = dependency('cairo', required: false, disabler: true)
# Only needed for drm_fourcc.h
libdrm_header = dependency('libdrm').partial_dependency(compile_args: true, includes: true)
wayland_client = dependency('wayland-client', required: false, disabler: true)
wayland_egl = dependency('wayland-egl', required: false, disabler: true)
egl = dependency('egl', version: '>= 1.5', required: false, disabler: true)
glesv2 = dependency('glesv2', required: false, disabler: true)

compositors = {
	'simple': {
		'src': 'simple.c',
	},
	'pointer': {
		'src': 'pointer.c',
	},
	'touch': {
		'src': ['touch.c', 'cat.c'],
	},
	'tablet': {
		'src': 'tablet.c',
	},
	'rotation': {
		'src': ['rotation.c', 'cat.c'],
	},
	'output-layout': {
		'src': ['output-layout.c', 'cat.c'],
	},
	'fullscreen-shell': {
		'src': 'fullscreen-shell.c',
		'proto': ['fullscreen-shell-unstable-v1'],
	},
	'scene-graph': {
		'src': 'scene-graph.c',
		'proto': ['xdg-shell'],
	},
	'output-layers': {
		'src': 'output-layers.c',
		'proto': [
			'xdg-shell',
		],
	},
	'cairo-buffer': {
		'src': 'cairo-buffer.c',
		'dep': cairo,
	},
	'embedded': {
		'src': [
			'embedded.c',
			protocols_code['xdg-shell'],
			protocols_client_header['xdg-shell'],
		],
		'dep': [wayland_client, wayland_egl, egl, glesv2],
	},
}

foreach name, info : compositors
	extra_src = []
	foreach p : info.get('proto', [])
		extra_src += protocols_server_header[p]
	endforeach

	executable(
		name,
		[info.get('src'), extra_src],
		dependencies: [wlroots, libdrm_header, info.get('dep', [])],
		build_by_default: get_option('examples'),
	)
endforeach