meson.build: adds V4L2 header and enablement reporting via summary()

Until now the 'v4l2' feature was not actually checking that its
required header has been found, this commit adds a check for
<linux/videodev2.h> and correctly reports both header status and whether
the feature itself ends up enabled (depends on libudev).
This commit is contained in:
Niklāvs Koļesņikovs 2021-06-25 14:54:26 +03:00
parent b55bafae09
commit de72ed5590
No known key found for this signature in database
GPG key ID: 8A45FF71F7C7210A

View file

@ -40,7 +40,12 @@ endif
if vulkan_headers
subdir('vulkan')
endif
if libudev_dep.found() and not get_option('v4l2').disabled()
v4l2_header_found = cc.has_header('linux/videodev2.h', required: get_option('v4l2'))
v4l2_supported = libudev_dep.found() and v4l2_header_found
summary({'V4L2 kernel header': v4l2_header_found}, bool_yn: true, section: 'Backend')
summary({'V4L2 enabled': v4l2_supported}, bool_yn: true, section: 'Backend')
if v4l2_supported
subdir('v4l2')
endif
if libcamera_dep.found()