va: meson: Move back libgudev dependency to plugin.
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Sun, 3 Oct 2021 13:45:58 +0000 (15:45 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Mon, 4 Oct 2021 10:19:36 +0000 (10:19 +0000)
When move the libgstva, libgudev dependency was moved as part of the
library, though it's not use by the library but the plugin. This patch
moves back libgudev dependency to the plugin.

Also HAVE_LIBDRM is move to the library which is the one who use it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1027>

subprojects/gst-plugins-bad/gst-libs/gst/va/meson.build
subprojects/gst-plugins-bad/sys/va/meson.build

index 2591819..a58032f 100644 (file)
@@ -26,13 +26,14 @@ libva_drm_dep = dependency('libva-drm', version: libva_req, required: va_option)
 libgudev_dep = dependency('gudev-1.0', required: va_option)
 libdrm_dep = dependency('libdrm', required: false, fallback: ['libdrm', 'ext_libdrm'])
 
-if not (libva_dep.found() and libva_drm_dep.found() and libgudev_dep.found())
+if not (libva_dep.found() and libva_drm_dep.found())
   if va_option.enabled()
     error('The va lib was enabled explicity, but required dependencies were not found.')
   endif
   subdir_done()
 endif
 
+cdata.set10('HAVE_LIBDRM', libdrm_dep.found())
 
 gstva = library('gstva-' + api_version,
   va_sources,
@@ -41,7 +42,7 @@ gstva = library('gstva-' + api_version,
   version : libversion,
   soversion : soversion,
   install : true,
-  dependencies : [gst_dep, libva_dep, libva_drm_dep, libgudev_dep, libdrm_dep],
+  dependencies : [gst_dep, libva_dep, libva_drm_dep, libdrm_dep],
 )
 
 pkgconfig.generate(gstva,
@@ -54,5 +55,5 @@ pkgconfig.generate(gstva,
 
 gstva_dep = declare_dependency(link_with : gstva,
   include_directories : [libsinc],
-  dependencies : [gst_dep, libva_dep, libva_drm_dep, libgudev_dep, libdrm_dep])
+  dependencies : [gst_dep, libva_dep, libva_drm_dep, libdrm_dep])
 meson.override_dependency('gstreamer-va-1.0', gstva_dep)
index 6106b8a..4d33fad 100644 (file)
@@ -26,7 +26,9 @@ if va_option.disabled() or host_system != 'linux'
   subdir_done()
 endif
 
-if not gstva_dep.found()
+libgudev_dep = dependency('gudev-1.0', required: va_option)
+
+if not gstva_dep.found() or not libgudev_dep.found()
   if va_option.enabled()
     error('The va plugin was enabled explicity, but required dependencies were not found.')
   endif
@@ -37,7 +39,6 @@ if libva_dep.version().version_compare('>= 1.8')
   va_sources += 'gstvaav1dec.c'
 endif
 
-cdata.set10('HAVE_LIBDRM', libdrm_dep.found())
 
 driverdir = libva_dep.get_variable(pkgconfig: 'driverdir', internal: 'driverdir', default_value: '')
 if driverdir == ''
@@ -49,7 +50,7 @@ gstva = library('gstva',
   va_sources,
   c_args : gst_plugins_bad_args + extra_c_args + gstva_cargs + ['-std=c99'],
   include_directories : [configinc],
-  dependencies : [libva_dep, gstvideo_dep, gstcodecs_dep, gstallocators_dep, gstva_dep] + extra_dep,
+  dependencies : [gstvideo_dep, gstcodecs_dep, gstallocators_dep, gstva_dep, libgudev_dep] + extra_dep,
   install : true,
   install_dir : plugins_install_dir,
 )