• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1if get_option('resize-pool')
2	config_h.set('USE_RESIZE_POOL', '1')
3endif
4
5srcs_toytoolkit = [
6	'window.c',
7	xdg_shell_client_protocol_h,
8	xdg_shell_protocol_c,
9	text_cursor_position_client_protocol_h,
10	text_cursor_position_protocol_c,
11	relative_pointer_unstable_v1_client_protocol_h,
12	relative_pointer_unstable_v1_protocol_c,
13	pointer_constraints_unstable_v1_client_protocol_h,
14	pointer_constraints_unstable_v1_protocol_c,
15	ivi_application_client_protocol_h,
16	ivi_application_protocol_c,
17	viewporter_client_protocol_h,
18	viewporter_protocol_c,
19]
20deps_toytoolkit = [
21	dep_wayland_client,
22	dep_lib_cairo_shared,
23	dep_xkbcommon,
24	dependency('wayland-cursor'),
25	cc.find_library('util'),
26]
27lib_toytoolkit = static_library(
28	'toytoolkit',
29	srcs_toytoolkit,
30	include_directories: common_inc,
31	dependencies: deps_toytoolkit,
32	install: false,
33)
34dep_toytoolkit = declare_dependency(
35	link_with: lib_toytoolkit,
36	dependencies: deps_toytoolkit,
37)
38
39simple_clients = [
40	{
41		'name': 'damage',
42		'sources': [
43			'simple-damage.c',
44			viewporter_client_protocol_h,
45			viewporter_protocol_c,
46			xdg_shell_client_protocol_h,
47			xdg_shell_protocol_c,
48			fullscreen_shell_unstable_v1_client_protocol_h,
49			fullscreen_shell_unstable_v1_protocol_c,
50		],
51		'dep_objs': [ dep_wayland_client, dep_libshared ]
52	},
53	{
54		'name': 'dmabuf-egl',
55		'sources': [
56			'simple-dmabuf-egl.c',
57			linux_dmabuf_unstable_v1_client_protocol_h,
58			linux_dmabuf_unstable_v1_protocol_c,
59			linux_explicit_synchronization_unstable_v1_client_protocol_h,
60			linux_explicit_synchronization_unstable_v1_protocol_c,
61			xdg_shell_client_protocol_h,
62			xdg_shell_protocol_c,
63			weston_direct_display_client_protocol_h,
64			weston_direct_display_protocol_c,
65			fullscreen_shell_unstable_v1_client_protocol_h,
66			fullscreen_shell_unstable_v1_protocol_c,
67		],
68		'dep_objs': [
69			dep_wayland_client,
70			dep_libdrm,
71			dep_libm
72		],
73		'deps': [ 'egl', 'glesv2', 'gbm' ],
74		'options': [ 'renderer-gl' ]
75	},
76	{
77		'name': 'dmabuf-v4l',
78		'sources': [
79			'simple-dmabuf-v4l.c',
80			linux_dmabuf_unstable_v1_client_protocol_h,
81			linux_dmabuf_unstable_v1_protocol_c,
82			xdg_shell_client_protocol_h,
83			xdg_shell_protocol_c,
84			weston_direct_display_client_protocol_h,
85			weston_direct_display_protocol_c,
86			fullscreen_shell_unstable_v1_client_protocol_h,
87			fullscreen_shell_unstable_v1_protocol_c,
88		],
89		'dep_objs': [ dep_wayland_client, dep_libdrm_headers ]
90	},
91	{
92		'name': 'egl',
93		'sources': [
94			'simple-egl.c',
95			xdg_shell_client_protocol_h,
96			xdg_shell_protocol_c,
97			ivi_application_client_protocol_h,
98			ivi_application_protocol_c,
99		],
100		'dep_objs': [ dep_wayland_client, dep_libshared, dep_libm ],
101		'deps': [ 'egl', 'wayland-egl', 'glesv2', 'wayland-cursor' ],
102		'options': [ 'renderer-gl' ]
103	},
104	# weston-simple-im is handled specially separately due to install_dir and odd window.h usage
105	{
106		'name': 'shm',
107		'sources': [
108			'simple-shm.c',
109			xdg_shell_client_protocol_h,
110			xdg_shell_protocol_c,
111			fullscreen_shell_unstable_v1_client_protocol_h,
112			fullscreen_shell_unstable_v1_protocol_c,
113			ivi_application_client_protocol_h,
114			ivi_application_protocol_c,
115		],
116		'dep_objs': [ dep_wayland_client, dep_libshared ]
117	},
118	{
119		'name': 'touch',
120		'sources': [
121			'simple-touch.c',
122		],
123		'dep_objs': [ dep_wayland_client, dep_libshared ]
124	},
125]
126
127simple_clients_enabled = get_option('simple-clients')
128simple_build_all = simple_clients_enabled.contains('all')
129foreach t : simple_clients
130	if simple_build_all or simple_clients_enabled.contains(t.get('name'))
131		t_name = 'weston-simple-' + t.get('name')
132		t_deps = t.get('dep_objs', [])
133		foreach depname : t.get('deps', [])
134			dep = dependency(depname, required: false)
135			if not dep.found()
136				error('@0@ requires @1@ which was not found. If you rather not build this, drop "@2@" from simple-clients option.'.format(t_name, depname, t.get('name')))
137			endif
138			t_deps += dep
139		endforeach
140
141		foreach optname : t.get('options', [])
142			if not get_option(optname)
143				error('@0@ requires option @1@ which is not enabled. If you rather not build this, drop "@2@" from simple-clients option.'.format(t_name, optname, t.get('name')))
144			endif
145		endforeach
146
147		executable(
148			t_name, t.get('sources'),
149			include_directories: common_inc,
150			dependencies: t_deps,
151			install: true
152		)
153	endif
154endforeach
155
156if simple_build_all or simple_clients_enabled.contains('im')
157	executable(
158		'weston-simple-im', [
159			'simple-im.c',
160			input_method_unstable_v1_client_protocol_h,
161			input_method_unstable_v1_protocol_c,
162		],
163		include_directories: common_inc,
164		dependencies: [
165			dep_libshared,
166			dep_wayland_client,
167			dep_xkbcommon,
168			dependency('wayland-cursor'),
169			dependency('cairo')
170		],
171		install: true,
172		install_dir: dir_libexec
173	)
174endif
175
176tools_enabled = get_option('tools')
177tools_list = [
178	{
179		'name': 'calibrator',
180		'sources': [ 'calibrator.c' ],
181		'deps': [ dep_toytoolkit, dep_matrix_c ],
182	},
183	{
184		'name': 'debug',
185		'sources': [
186			'weston-debug.c',
187			weston_debug_client_protocol_h,
188			weston_debug_protocol_c,
189		],
190		'deps': [ dep_wayland_client ]
191	},
192	{
193		'name': 'info',
194		'sources': [
195			'weston-info.c',
196			presentation_time_client_protocol_h,
197			presentation_time_protocol_c,
198			linux_dmabuf_unstable_v1_client_protocol_h,
199			linux_dmabuf_unstable_v1_protocol_c,
200			tablet_unstable_v2_client_protocol_h,
201			tablet_unstable_v2_protocol_c,
202			xdg_output_unstable_v1_client_protocol_h,
203			xdg_output_unstable_v1_protocol_c,
204		],
205		'deps': [ dep_wayland_client, dep_libshared ]
206	},
207	{
208		'name': 'terminal',
209		'sources': [ 'terminal.c' ],
210		'deps': [ dep_toytoolkit ],
211	},
212	{
213		'name': 'touch-calibrator',
214		'sources': [
215			'touch-calibrator.c',
216			weston_touch_calibration_client_protocol_h,
217			weston_touch_calibration_protocol_c,
218		],
219		'deps': [ dep_toytoolkit, dep_matrix_c ],
220	},
221]
222
223foreach t : tools_list
224	if tools_enabled.contains(t.get('name'))
225		executable(
226			'weston-@0@'.format(t.get('name')),
227			t.get('sources'),
228			include_directories: common_inc,
229			dependencies: t.get('deps', []),
230			install: true
231		)
232	endif
233endforeach
234
235demo_clients = [
236	{ 'basename': 'clickdot' },
237	{
238		'basename': 'cliptest',
239		'dep_objs': dep_vertex_clipping
240	},
241	{ 'basename': 'confine' },
242	{
243		'basename': 'content_protection',
244		'add_sources': [
245			weston_content_protection_client_protocol_h,
246			weston_content_protection_protocol_c,
247		]
248	},
249
250	{ 'basename': 'dnd' },
251	{
252		'basename': 'editor',
253		'add_sources': [
254			text_input_unstable_v1_client_protocol_h,
255			text_input_unstable_v1_protocol_c,
256		],
257		'deps': [ 'pangocairo', 'gobject-2.0' ]
258	},
259	{ 'basename': 'eventdemo' },
260	{ 'basename': 'flower' },
261	{
262		'basename': 'fullscreen',
263		'add_sources': [
264			fullscreen_shell_unstable_v1_client_protocol_h,
265			fullscreen_shell_unstable_v1_protocol_c,
266		]
267	},
268	{ 'basename': 'image' },
269	{ 'basename': 'multi-resource' },
270	{
271		'basename': 'presentation-shm',
272		'add_sources': [
273			presentation_time_client_protocol_h,
274			presentation_time_protocol_c,
275			xdg_shell_client_protocol_h,
276			xdg_shell_protocol_c,
277		]
278	},
279	{ 'basename': 'resizor' },
280	{
281		'basename': 'scaler',
282		'add_sources': [
283			viewporter_client_protocol_h,
284			viewporter_protocol_c,
285		]
286	},
287	{ 'basename': 'smoke' },
288	{ 'basename': 'stacking' },
289	{
290		'basename': 'subsurfaces',
291		'deps': [ 'egl', 'glesv2', 'wayland-egl' ]
292	},
293	{ 'basename': 'transformed' },
294]
295
296if get_option('demo-clients')
297	foreach t : demo_clients
298		t_name = 'weston-' + t.get('basename')
299		t_srcs = [ t.get('basename') + '.c' ] + t.get('add_sources', [])
300		t_deps = [ dep_toytoolkit, t.get('dep_objs', []) ]
301		foreach depname : t.get('deps', [])
302			dep = dependency(depname, required: false)
303			if not dep.found()
304				error('@0@ requires \'@1@\' which was not found. If you rather not build this, set \'-Ddemo-clients=false\'.'.format(t_name, depname))
305			endif
306			t_deps += dep
307		endforeach
308
309		executable(
310			t_name, t_srcs,
311			include_directories: common_inc,
312			dependencies: t_deps,
313			install: true
314		)
315	endforeach
316endif
317
318if get_option('shell-desktop')
319	exe_keyboard = executable(
320		'weston-keyboard',
321		'keyboard.c',
322		text_input_unstable_v1_client_protocol_h,
323		text_input_unstable_v1_protocol_c,
324		input_method_unstable_v1_client_protocol_h,
325		input_method_unstable_v1_protocol_c,
326		include_directories: common_inc,
327		dependencies: dep_toytoolkit,
328		install_dir: get_option('libexecdir'),
329		install: true
330	)
331	env_modmap += 'weston-keyboard=@0@;'.format(exe_keyboard.full_path())
332
333	exe_shooter = executable(
334		'weston-screenshooter',
335		'screenshot.c',
336		weston_screenshooter_client_protocol_h,
337		weston_screenshooter_protocol_c,
338		include_directories: common_inc,
339		dependencies: dep_toytoolkit,
340		install_dir: get_option('bindir'),
341		install: true
342	)
343	env_modmap += 'weston-screenshooter=@0@;'.format(exe_shooter.full_path())
344
345	exe_shell_desktop = executable(
346		'weston-desktop-shell',
347		'desktop-shell.c',
348		weston_desktop_shell_client_protocol_h,
349		weston_desktop_shell_protocol_c,
350		include_directories: common_inc,
351		dependencies: dep_toytoolkit,
352		install_dir: get_option('libexecdir'),
353		install: true
354	)
355	env_modmap += 'weston-desktop-shell=@0@;'.format(exe_shell_desktop.full_path())
356endif
357
358
359if get_option('shell-ivi')
360	exe_shell_ivi_ui = executable(
361		'weston-ivi-shell-user-interface',
362		'ivi-shell-user-interface.c',
363		ivi_hmi_controller_client_protocol_h,
364		ivi_hmi_controller_protocol_c,
365		ivi_application_client_protocol_h,
366		ivi_application_protocol_c,
367		include_directories: common_inc,
368		dependencies: dep_toytoolkit,
369		install: true,
370		install_dir: get_option('libexecdir')
371	)
372	env_modmap += 'weston-ivi-shell-user-interface=@0@;'.format(exe_shell_ivi_ui.full_path())
373endif
374