meson: add build files for vulkan
authorMatthew Waters <matthew@centricular.com>
Fri, 9 Sep 2016 06:55:23 +0000 (16:55 +1000)
committerMatthew Waters <matthew@centricular.com>
Fri, 9 Sep 2016 06:55:23 +0000 (16:55 +1000)
ext/meson.build
ext/vulkan/meson.build [new file with mode: 0644]
ext/vulkan/vkconfig.h.meson [new file with mode: 0644]

index 09f4bb0..eaebd80 100644 (file)
@@ -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 (file)
index 0000000..80e162e
--- /dev/null
@@ -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 (file)
index 0000000..bd58da9
--- /dev/null
@@ -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 <gst/gst.h>
+
+G_BEGIN_DECLS
+
+#mesondefine GST_VULKAN_HAVE_WINDOW_XCB
+#mesondefine GST_VULKAN_HAVE_WINDOW_WAYLAND
+
+G_END_DECLS
+
+#endif  /* __GST_VULKAN_CONFIG_H__ */