meson: friendly error for simple-dmabuf-drm

This is probably the most annoying ones. Some distributions do not even package
a libdrm_${driver} if the driver's hardware does not occur on the CPU
architecture, e.g. Debian x86_64 does not have libdrm_etnaviv.

Helps people to disable those.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This commit is contained in:
Pekka Paalanen 2019-01-17 15:49:10 +02:00 committed by Daniel Stone
parent 9985c534b8
commit fb61e45de2
1 changed files with 3 additions and 1 deletions

View File

@ -307,10 +307,12 @@ foreach driver : [ 'etnaviv', 'intel', 'freedreno' ]
endif
if enabled
dep = dependency('libdrm_' + driver, required: required)
dep = dependency('libdrm_' + driver, required: false)
if dep.found()
simple_dmabuf_drm_deps += dep
config_h.set('HAVE_LIBDRM_' + driver.to_upper(), 1)
elif required
error('simple-dmabuf-drm is configured to use @0@ but it was not found. Or, you can remove @1@ from \'-Dsimple-dmabuf-drm\' list.'.format('libdrm_' + driver, driver))
endif
endif
endforeach