aboutsummaryrefslogtreecommitdiff
path: root/render/vulkan/meson.build
blob: 6ae8df0c3dcb460778b7c87c41160b5a12381bcd (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
msg = []
if 'vulkan' in renderers
	msg += 'Install "@0@" or pass "-Dvulkan=disabled" to disable it.'
else
	msg += 'Required for vulkan renderer support.'
endif

dep_vulkan = dependency('vulkan',
	version: '>=1.2.182',
	required: 'vulkan' in renderers,
	not_found_message: '\n'.join(msg).format('vulkan')
)
if not dep_vulkan.found()
	subdir_done()
endif

# Vulkan headers are installed separately from the loader (which ships the
# pkg-config file)
if not cc.check_header('vulkan/vulkan.h', dependencies: dep_vulkan)
	if 'vulkan' in renderers
		error('\n'.join(msg).format('vulkan-headers'))
	else
		subdir_done()
	endif
endif

glslang = find_program('glslangValidator', native: true, required: false)
if not glslang.found()
	if 'vulkan' in renderers
		error('\n'.join(msg).format('glslang'))
	else
		subdir_done()
	endif
endif

wlr_files += files(
	'renderer.c',
	'texture.c',
	'vulkan.c',
	'util.c',
	'pixel_format.c',
)

wlr_deps += dep_vulkan
features += { 'vulkan-renderer': true }

subdir('shaders')