Merge branch 'wip/abono/meson-dma-buf' into 'main'

meson: Don't make linux/dma-buf.h a requirement for Linux

See merge request GNOME/gtk!6904
This commit is contained in:
Matthias Clasen
2024-02-16 14:40:21 +00:00
4 changed files with 10 additions and 16 deletions

View File

@@ -1,7 +1,7 @@
#pragma once
#include "config.h"
#ifdef HAVE_DMABUF
#ifdef HAVE_DRM_FOURCC_H
#include <drm_fourcc.h>
#endif

View File

@@ -219,7 +219,7 @@ gdk_deps = [
platform_gio_dep,
pangocairo_dep,
vulkan_dep,
dmabuf_dep,
libdrm_dep,
png_dep,
tiff_dep,
jpeg_dep,

View File

@@ -168,16 +168,16 @@ check_headers = [
'memory.h',
'stdint.h',
'stdlib.h',
'strings.h',
'string.h',
'strings.h',
'sys/mman.h',
'sys/param.h',
'sys/stat.h',
'sys/sysinfo.h',
'sys/sysmacros.h',
'sys/systeminfo.h',
'sys/time.h',
'sys/types.h',
'sys/sysmacros.h',
'unistd.h',
]
@@ -628,19 +628,13 @@ else
vulkan_pkg_found = false
endif
if cc.has_header('linux/dma-buf.h')
dmabuf_dep = dependency('libdrm',
required: os_linux)
else
if os_linux
error('OS is Linux, but linux/dma-buf.h not found.')
endif
dmabuf_dep = dependency('', required: false)
endif
cdata.set('HAVE_DMABUF', dmabuf_dep.found())
libdrm_dep = dependency('libdrm', required: os_linux)
# We only care about drm_fourcc.h for all the fourccs,
# but not about linking to libdrm
dmabuf_dep = dmabuf_dep.partial_dependency(includes: true, compile_args: true)
libdrm_dep = libdrm_dep.partial_dependency(includes: true, compile_args: true)
cdata.set('HAVE_DRM_FOURCC_H', libdrm_dep.found())
cdata.set('HAVE_DMABUF', cc.has_header('linux/dma-buf.h'))
cloudproviders_dep = dependency('cloudproviders',
required: get_option('cloudproviders'),

View File

@@ -24,7 +24,7 @@ if gstplayer_dep.found() and gstgl_dep.found()
cdata.set('HAVE_GSTREAMER', 1)
media_gst_deps = [ libm, libgtk_dep, gstplayer_dep, gstgl_dep ]
if dmabuf_dep.found() and gstdrm_dep.found()
if libdrm_dep.found() and gstdrm_dep.found()
cdata.set('HAVE_GSTREAMER_DRM', 1)
media_gst_deps += [ gstdrm_dep ]
endif