[gtk+] build: Make sure GTK compiles without Vulkan headers installed



commit 2c0564a46e9dab44038483a234a7339a99cebc94
Author: Benjamin Otte <otte redhat com>
Date:   Fri Dec 9 20:21:18 2016 +0100

    build: Make sure GTK compiles without Vulkan headers installed
    
    Previously, code would work fine with --disable-vulkan if the Vulkan
    headers were installed - code would happily just use them as they're
    installed in /usr/include.

 gdk/gdkvulkancontext.c        |   10 +++++-----
 gdk/gdkvulkancontextprivate.h |    2 ++
 2 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/gdk/gdkvulkancontext.c b/gdk/gdkvulkancontext.c
index 693b36c..0fe921d 100644
--- a/gdk/gdkvulkancontext.c
+++ b/gdk/gdkvulkancontext.c
@@ -20,11 +20,9 @@
 
 #include "config.h"
 
-#include "gdkvulkancontextprivate.h"
+#include "gdkvulkancontext.h"
 
-#ifdef GDK_RENDERING_VULKAN
-#include <vulkan/vulkan.h>
-#endif
+#include "gdkvulkancontextprivate.h"
 
 #include "gdkdisplayprivate.h"
 #include "gdkinternals.h"
@@ -33,6 +31,7 @@
 typedef struct _GdkVulkanContextPrivate GdkVulkanContextPrivate;
 
 struct _GdkVulkanContextPrivate {
+#ifdef GDK_RENDERING_VULKAN
   VkSurfaceKHR surface;
   VkSurfaceFormatKHR image_format;
 
@@ -42,8 +41,9 @@ struct _GdkVulkanContextPrivate {
 
   guint n_images;
   VkImage *images;
+#endif
 
-  uint32_t draw_index;
+  guint32 draw_index;
 };
 
 enum {
diff --git a/gdk/gdkvulkancontextprivate.h b/gdk/gdkvulkancontextprivate.h
index 6142c04..bc46b8e 100644
--- a/gdk/gdkvulkancontextprivate.h
+++ b/gdk/gdkvulkancontextprivate.h
@@ -47,8 +47,10 @@ struct _GdkVulkanContextClass
 {
   GdkDrawContextClass parent_class;
 
+#ifdef GDK_RENDERING_VULKAN
   VkResult     (* create_surface)       (GdkVulkanContext       *context,
                                          VkSurfaceKHR           *surface);
+#endif
 };
 
 #ifdef GDK_RENDERING_VULKAN


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]