• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1srcs_weston = [
2	git_version_h,
3	'main.c',
4	'testsuite-util.c',
5	'text-backend.c',
6	'weston-screenshooter.c',
7	text_input_unstable_v1_server_protocol_h,
8	text_input_unstable_v1_protocol_c,
9	input_method_unstable_v1_server_protocol_h,
10	input_method_unstable_v1_protocol_c,
11	weston_screenshooter_server_protocol_h,
12	weston_screenshooter_protocol_c,
13]
14deps_weston = [
15	dep_libshared,
16	dep_libweston_public,
17	dep_libinput,
18	dep_libevdev,
19	dep_libdl,
20	dep_threads,
21]
22
23if get_option('xwayland')
24	config_h.set('BUILD_XWAYLAND', '1')
25
26	srcs_weston += 'xwayland.c'
27	config_h.set_quoted('XSERVER_PATH', get_option('xwayland-path'))
28endif
29
30libexec_weston = shared_library(
31	'exec_weston',
32	sources: srcs_weston,
33	include_directories: common_inc,
34	dependencies: deps_weston,
35	install_dir: dir_module_weston,
36	install: true,
37	version: '0.0.0',
38	soversion: 0
39)
40dep_libexec_weston = declare_dependency(
41	link_with: libexec_weston,
42	include_directories: [ include_directories('.'), public_inc ],
43	dependencies: dep_libweston_public
44)
45exe_weston = executable(
46	'weston',
47	'executable.c',
48	include_directories: common_inc,
49	dependencies: dep_libexec_weston,
50	install_rpath: dir_module_weston,
51	install: true
52)
53install_headers('weston.h', subdir: 'weston')
54
55pkgconfig.generate(
56	filebase: 'weston',
57	name: 'Weston Plugin API',
58	version: version_weston,
59	description: 'Header files for Weston plugin development',
60	requires_private: [ lib_weston ],
61	variables: [
62		'libexecdir=' + join_paths('${prefix}', get_option('libexecdir')),
63		'pkglibexecdir=${libexecdir}/weston'
64	],
65	subdirs: 'weston'
66)
67
68install_data(
69	'weston.desktop',
70	install_dir: join_paths(dir_data, 'wayland-sessions')
71)
72
73if get_option('screenshare')
74	srcs_screenshare = [
75		'screen-share.c',
76		fullscreen_shell_unstable_v1_client_protocol_h,
77		fullscreen_shell_unstable_v1_protocol_c,
78	]
79	deps_screenshare = [
80		dep_libexec_weston,
81		dep_libshared,
82		dep_libweston_public,
83		dep_libweston_private_h, # XXX: https://gitlab.freedesktop.org/wayland/weston/issues/292
84		dep_wayland_client,
85	]
86	plugin_screenshare = shared_library(
87		'screen-share',
88		srcs_screenshare,
89		include_directories: common_inc,
90		dependencies: deps_screenshare,
91		name_prefix: '',
92		install: true,
93		install_dir: dir_module_weston,
94		install_rpath: '$ORIGIN'
95	)
96	env_modmap += 'screen-share.so=@0@;'.format(plugin_screenshare.full_path())
97endif
98
99if get_option('color-management-lcms')
100	config_h.set('HAVE_LCMS', '1')
101
102	srcs_lcms = [
103		'cms-static.c',
104		'cms-helper.c',
105	]
106
107	dep_lcms2 = dependency('lcms2', required: false)
108	if not dep_lcms2.found()
109		error('cms-static requires lcms2 which was not found. Or, you can use \'-Dcolor-management-lcms=false\'.')
110	endif
111
112	plugin_lcms = shared_library(
113		'cms-static',
114		srcs_lcms,
115		include_directories: common_inc,
116		dependencies: [ dep_libexec_weston, dep_libweston_public, dep_lcms2 ],
117		name_prefix: '',
118		install: true,
119		install_dir: dir_module_weston,
120		install_rpath: '$ORIGIN'
121	)
122	env_modmap += 'cms-static.so=@0@;'.format(plugin_lcms.full_path())
123endif
124
125if get_option('color-management-colord')
126	if not get_option('color-management-lcms')
127		error('LCMS must be enabled to support colord')
128	endif
129
130	srcs_colord = [
131		'cms-colord.c',
132		'cms-helper.c',
133	]
134
135	dep_colord = dependency('colord', version: '>= 0.1.27', required: false)
136	if not dep_colord.found()
137		error('cms-colord requires colord >= 0.1.27 which was not found. Or, you can use \'-Dcolor-management-colord=false\'.')
138	endif
139
140	plugin_colord_deps = [ dep_libweston_public, dep_colord, dep_lcms2 ]
141
142	foreach depname : [ 'glib-2.0', 'gobject-2.0' ]
143		dep = dependency(depname, required: false)
144		if not dep.found()
145			error('cms-colord requires \'@0@\' which was not found. If you rather not build this, set \'-Dcolor-management-colord=false\'.'.format(depname))
146		endif
147		plugin_colord_deps += dep
148	endforeach
149
150	plugin_colord = shared_library(
151		'cms-colord',
152		srcs_colord,
153		include_directories: common_inc,
154		dependencies: plugin_colord_deps,
155		name_prefix: '',
156		install: true,
157		install_dir: dir_module_weston
158	)
159	env_modmap += 'cms-colord.so=@0@;'.format(plugin_colord.full_path())
160endif
161
162if get_option('systemd')
163	dep_libsystemd = dependency('libsystemd', required: false)
164	if not dep_libsystemd.found()
165		error('systemd-notify requires libsystemd which was not found. Or, you can use \'-Dsystemd=false\'.')
166	endif
167
168	plugin_systemd_notify = shared_library(
169		'systemd-notify',
170		'systemd-notify.c',
171		include_directories: common_inc,
172		dependencies: [ dep_libweston_public, dep_libsystemd ],
173		name_prefix: '',
174		install: true,
175		install_dir: dir_module_weston
176	)
177	env_modmap += 'systemd-notify.so=@0@;'.format(plugin_systemd_notify.full_path())
178endif
179
180weston_ini_config = configuration_data()
181weston_ini_config.set('bindir', dir_bin)
182weston_ini_config.set('libexecdir', dir_libexec)
183configure_file(
184	input: '../weston.ini.in',
185	output: 'weston.ini',
186	configuration: weston_ini_config
187)
188