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