summaryrefslogtreecommitdiff
path: root/cursor/meson.build
blob: f7d82e4ee0872b449b2411e273b589ae7db060f9 (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
icondir = get_option('icon_directory')
if icondir == ''
	icondir = join_paths(get_option('prefix'), get_option('datadir'), 'icons')
endif

if wayland_version[0] != '1'
	# The versioning used for the shared libraries assumes that the major
	# version of Wayland as a whole will increase to 2 if and only if there
	# is an ABI break, at which point we should probably bump the SONAME of
	# all libraries to .so.2. For more details see
	# https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/177
	error('We probably need to bump the SONAME of libwayland-cursor')
endif

wayland_cursor = library(
	'wayland-cursor',
	sources: [
		'wayland-cursor.c',
		'os-compatibility.c',
		'xcursor.c',
	],
	# To avoid an unnecessary SONAME bump, wayland 1.x.y produces
	# libwayland-cursor.so.0.x.y.
	version: '.'.join(['0', wayland_version[1], wayland_version[2]]),
	dependencies: [ wayland_client_dep ],
	c_args: [ '-DICONDIR="@0@"'.format(icondir) ],
	install: true,
)

install_headers('wayland-cursor.h')

pkgconfig.generate(
	name: 'Wayland Cursor',
	description: 'Wayland cursor helper library',
	version: meson.project_version(),
	libraries: wayland_cursor,
	filebase: 'wayland-cursor',
)

wayland_cursor_dep = declare_dependency(
	link_with: wayland_cursor,
	include_directories: [ root_inc, include_directories('.') ],
)

if meson.version().version_compare('>= 0.54.0')
	meson.override_dependency('wayland-cursor', wayland_cursor_dep)
endif