gstreamer/ext/vulkan/meson.build
Tim-Philipp Müller b75ad03313 vulkan: don't run tests or build lib if plugin isn't actually built
The unit tests only checked for vulkan_dep.found(), which can
be true if the libs are there but glslc was not found, in which
case the plugin wouldn't be built and the unit tests would fail
because of missing vulkan plugins.

Doesn't really make much sense to build the vulkan integration lib
either if we're not going to build the vulkan plugin, so just disable
both for now if glslc is not available.

Fixes #1301

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1307>
2020-05-28 19:07:32 +01:00

51 lines
1.4 KiB
Meson

if get_option('vulkan').disabled()
subdir_done()
endif
if not gstvulkan_dep.found()
if get_option('vulkan').enabled()
error('GStreamer Vulkan plugin required via options, but needed dependencies not found.')
else
subdir_done()
endif
endif
assert(glslc.found())
subdir('shaders')
vulkan_sources = [
'gstvulkan.c',
'vkcolorconvert.c',
'vkdownload.c',
'vkdeviceprovider.c',
'vkimageidentity.c',
'vksink.c',
'vkupload.c',
'vkviewconvert.c',
]
vulkan_plugin_enum_headers = [
'vkviewconvert.h',
]
vulkan_plugin_enums = gnome.mkenums_simple('gstvulkan-plugins-enumtypes',
sources : vulkan_plugin_enum_headers,
body_prefix : '#ifdef HAVE_CONFIG_H\n#include "config.h"\n#endif',
header_prefix : '#include <gst/gst.h>')
vulkan_plugin_enumtypes_c = vulkan_plugin_enums[0]
vulkan_plugin_enumtypes_h = vulkan_plugin_enums[1]
vulkan_plugin_gen_sources = [vulkan_plugin_enumtypes_h]
gstvulkan_plugin = library('gstvulkan',
vulkan_sources, vulkan_compiled_shader_sources, vulkan_plugin_enumtypes_c, vulkan_plugin_enumtypes_h,
c_args : gst_plugins_bad_args,
objc_args : gst_plugins_bad_args,
link_args : noseh_link_args,
include_directories : [configinc],
dependencies : [gstvideo_dep, gstbase_dep, gstvulkan_dep, vulkan_dep],
install : true,
install_dir : plugins_install_dir,
)
pkgconfig.generate(gstvulkan_plugin, install_dir : plugins_pkgconfig_install_dir)
plugins += [gstvulkan_plugin]