From a969048003cc6f9480587d8a12ddcdcb1b483597 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Fri, 9 Sep 2016 16:55:23 +1000 Subject: [PATCH] meson: add build files for vulkan --- ext/meson.build | 1 + ext/vulkan/meson.build | 71 +++++++++++++++++++++++++++++++++++++++++++++ ext/vulkan/vkconfig.h.meson | 18 ++++++++++++ 3 files changed, 90 insertions(+) create mode 100644 ext/vulkan/meson.build create mode 100644 ext/vulkan/vkconfig.h.meson diff --git a/ext/meson.build b/ext/meson.build index 09f4bb0..eaebd80 100644 --- a/ext/meson.build +++ b/ext/meson.build @@ -64,6 +64,7 @@ subdir('srtp') #subdir('timidity') subdir('voaacenc') #subdir('voamrwbenc') +subdir('vulkan') #subdir('wayland') #subdir('webrtcdsp') subdir('webp') diff --git a/ext/vulkan/meson.build b/ext/vulkan/meson.build new file mode 100644 index 0000000..80e162e --- /dev/null +++ b/ext/vulkan/meson.build @@ -0,0 +1,71 @@ +vulkan_sources = [ + 'gstvulkan.c', + 'vkbuffermemory.c', + 'vkbufferpool.c', + 'vkdevice.c', + 'vkdisplay.c', + 'vkerror.c', + 'vkimagememory.c', + 'vkinstance.c', + 'vkmemory.c', + 'vkqueue.c', + 'vksink.c', + 'vkswapper.c', + 'vkupload.c', + 'vkutils.c', + 'vkwindow.c', +] + +vulkan_defines = [] +optional_deps = [] + +vulkan_dep = cc.find_library('vulkan', required : false) +has_vulkan_header = cc.has_header('vulkan/vulkan.h') +if vulkan_dep.found() and has_vulkan_header + have_vulkan_windowing = false + + vkconf = configuration_data() + + xcb_dep = dependency('xcb', version : '>=1.10', required : false) + if xcb_dep.found() + vulkan_sources += [ + 'xcb/vkdisplay_xcb.c', + 'xcb/vkwindow_xcb.c', + 'xcb/xcb_event_source.c', + ] + + optional_deps += xcb_dep + have_vulkan_windowing = true + vkconf.set10('GST_VULKAN_HAVE_WINDOW_XCB', 1) + endif + + wayland_client_dep = dependency('wayland-client', version : '>=1.4', required : false) + if wayland_client_dep.found() + vulkan_sources += [ + 'wayland/vkdisplay_wayland.c', + 'wayland/vkwindow_wayland.c', + 'wayland/wayland_event_source.c', + ] + + optional_deps += wayland_client_dep + have_vulkan_windowing = true + vkconf.set10('GST_VULKAN_HAVE_WINDOW_WAYLAND', 1) + endif + + if have_vulkan_windowing + configure_file(input : 'vkconfig.h.meson', + output : 'vkconfig.h', + configuration : vkconf) + + gstvulkan = library('gstvulkan', + vulkan_sources, + c_args : gst_plugins_bad_args + vulkan_defines, + link_args : noseh_link_args, + include_directories : [configinc], + dependencies : [vulkan_dep, gstvideo_dep, gstbase_dep] + optional_deps, + install : true, + install_dir : plugins_install_dir, + ) + endif +endif + diff --git a/ext/vulkan/vkconfig.h.meson b/ext/vulkan/vkconfig.h.meson new file mode 100644 index 0000000..bd58da9 --- /dev/null +++ b/ext/vulkan/vkconfig.h.meson @@ -0,0 +1,18 @@ +/* vkconfig.h + * + * This is a generated file. Please modify `configure.ac' + */ + +#ifndef __GST_VULKAN_CONFIG_H__ +#define __GST_VULKAN_CONFIG_H__ + +#include + +G_BEGIN_DECLS + +#mesondefine GST_VULKAN_HAVE_WINDOW_XCB +#mesondefine GST_VULKAN_HAVE_WINDOW_WAYLAND + +G_END_DECLS + +#endif /* __GST_VULKAN_CONFIG_H__ */ -- 2.7.4