xref: /aosp_15_r20/external/wayland/cursor/meson.build (revision 84e872a0dc482bffdb63672969dd03a827d67c73)
1icondir = get_option('icon_directory')
2if icondir == ''
3	icondir = join_paths(get_option('prefix'), get_option('datadir'), 'icons')
4endif
5
6if wayland_version[0] != '1'
7	# The versioning used for the shared libraries assumes that the major
8	# version of Wayland as a whole will increase to 2 if and only if there
9	# is an ABI break, at which point we should probably bump the SONAME of
10	# all libraries to .so.2. For more details see
11	# https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/177
12	error('We probably need to bump the SONAME of libwayland-cursor')
13endif
14
15wayland_cursor = library(
16	'wayland-cursor',
17	sources: [
18		'wayland-cursor.c',
19		'os-compatibility.c',
20		'xcursor.c',
21	],
22	# To avoid an unnecessary SONAME bump, wayland 1.x.y produces
23	# libwayland-cursor.so.0.x.y.
24	version: '.'.join(['0', wayland_version[1], wayland_version[2]]),
25	dependencies: [ wayland_client_dep ],
26	c_args: [ '-DICONDIR="@0@"'.format(icondir) ],
27	install: true,
28)
29
30install_headers('wayland-cursor.h')
31
32pkgconfig.generate(
33	name: 'Wayland Cursor',
34	description: 'Wayland cursor helper library',
35	version: meson.project_version(),
36	libraries: wayland_cursor,
37	filebase: 'wayland-cursor',
38)
39
40wayland_cursor_dep = declare_dependency(
41	link_with: wayland_cursor,
42	include_directories: [ root_inc, include_directories('.') ],
43)
44
45if meson.version().version_compare('>= 0.54.0')
46	meson.override_dependency('wayland-cursor', wayland_cursor_dep)
47endif
48