File: meson.build

package info (click to toggle)
wlroots 0.19.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,592 kB
  • sloc: ansic: 75,766; xml: 2,739; sh: 33; makefile: 23
file content (44 lines) | stat: -rw-r--r-- 1,261 bytes parent folder | download | duplicates (2)
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
allocators = get_option('allocators')
if 'auto' in allocators and get_option('auto_features').enabled()
	allocators = ['gbm', 'udmabuf']
elif 'auto' in allocators and get_option('auto_features').disabled()
	allocators = []
endif

wlr_files += files(
	'allocator.c',
	'shm.c',
	'drm_dumb.c',
)

gbm = disabler()
if 'gbm' in allocators or 'auto' in allocators
	gbm = dependency('gbm', version: '>=17.1.0', required: 'gbm' in allocators)
endif
if gbm.found()
	wlr_files += files('gbm.c')
	wlr_deps += gbm
	features += { 'gbm-allocator': true }

	has = cc.has_function('gbm_bo_get_fd_for_plane', dependencies: [gbm])
	internal_config.set10('HAVE_GBM_BO_GET_FD_FOR_PLANE', has)
endif

udmabuf = false
if 'udmabuf' in allocators or 'auto' in allocators
	args = ['-D_GNU_SOURCE']
	prefix = [
		'#include <sys/mman.h>',
		'#include <fcntl.h>',
	]
	udmabuf = (cc.has_function('memfd_create', args: args, prefix: prefix) and
		cc.has_define('F_ADD_SEALS', args: args, prefix: prefix) and
		cc.has_header('linux/udmabuf.h'))
endif
if 'udmabuf' in allocators and not udmabuf
	error('memfd_create(), F_ADD_SEALS and <linux/udmabuf.h> are required for the udmabuf allocator')
endif
if udmabuf
	wlr_files += files('udmabuf.c')
	features += { 'udmabuf-allocator': true }
endif