vulkan/wsi: Generate wayland protocol headers separately from EGL
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 2 Mar 2017 03:03:17 +0000 (19:03 -0800)
committerEmil Velikov <emil.l.velikov@gmail.com>
Mon, 13 Mar 2017 11:16:33 +0000 (11:16 +0000)
Previously, we were depending on EGL for generating the headers and
providing the protocol symbols. However, since neither Vulkan driver
actually wants to link against EGL, this is kind of pointless. It also
creates a weird build dependency.

v2 [Jason]
 - Add missing wsi/ prefix, MKDIR_GEN

v3 [Emil Velikov]
 - include BUILT_SOURCES/generation rules outside of conditional

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/amd/vulkan/Makefile.am
src/intel/vulkan/Makefile.am
src/vulkan/Makefile.am
src/vulkan/Makefile.sources
src/vulkan/wsi/.gitignore [new file with mode: 0644]
src/vulkan/wsi/wsi_common_wayland.c

index 3379a3d6a8998ceeefa9f4fcc8155e036392b475..fbd9f5a030554dd25b18c822b8e39ef42d433be9 100644 (file)
@@ -77,15 +77,12 @@ endif
 
 if HAVE_PLATFORM_WAYLAND
 AM_CPPFLAGS += \
-       -I$(top_builddir)/src/egl/wayland/wayland-drm \
-       -I$(top_srcdir)/src/egl/wayland/wayland-drm \
        $(WAYLAND_CFLAGS) \
        -DVK_USE_PLATFORM_WAYLAND_KHR
 
 VULKAN_SOURCES += $(VULKAN_WSI_WAYLAND_FILES)
 
 VULKAN_LIB_DEPS += \
-       $(top_builddir)/src/egl/wayland/wayland-drm/libwayland-drm.la \
        $(WAYLAND_LIBS)
 endif
 
index 3cd01e4d028292c016dde3fe6c977cfdd0c78894..6c902b52e100dd733d2a55f04b3c2e3c8f80ac8e 100644 (file)
@@ -63,12 +63,6 @@ AM_CPPFLAGS = \
        -I$(top_builddir)/src/intel \
        -I$(top_srcdir)/src/intel
 
-if HAVE_PLATFORM_WAYLAND
-AM_CPPFLAGS += \
-       -I$(top_builddir)/src/egl/wayland/wayland-drm \
-       -I$(top_srcdir)/src/egl/wayland/wayland-drm
-endif
-
 AM_CPPFLAGS += \
        $(LIBDRM_CFLAGS) \
        $(INTEL_CFLAGS) \
@@ -119,7 +113,6 @@ AM_CPPFLAGS += \
 VULKAN_SOURCES += $(VULKAN_WSI_WAYLAND_FILES)
 
 VULKAN_LIB_DEPS += \
-       $(top_builddir)/src/egl/wayland/wayland-drm/libwayland-drm.la \
        $(WAYLAND_LIBS)
 endif
 
index f7aca8e9371358a760593a46bcb61327bad9394a..f8d6fae40b429feac1b6e36d2b5aab5ed7a8cc92 100644 (file)
@@ -48,17 +48,29 @@ VULKAN_WSI_SOURCES += $(VULKAN_WSI_X11_FILES)
 VULKAN_LIB_DEPS += $(XCB_DRI3_LIBS) -lX11-xcb
 endif
 
+BUILT_SOURCES += $(VULKAN_WSI_WAYLAND_GENERATED_FILES)
+CLEANFILES = $(BUILT_SOURCES)
+
+WL_DRM_XML = $(top_srcdir)/src/egl/wayland/wayland-drm/wayland-drm.xml
+
+wsi/wayland-drm-protocol.c : $(WL_DRM_XML)
+       $(MKDIR_GEN)
+       $(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@
+
+wsi/wayland-drm-client-protocol.h : $(WL_DRM_XML)
+       $(MKDIR_GEN)
+       $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@
+
 if HAVE_PLATFORM_WAYLAND
 AM_CPPFLAGS += \
-       -I$(top_builddir)/src/egl/wayland/wayland-drm \
-       -I$(top_srcdir)/src/egl/wayland/wayland-drm \
        $(WAYLAND_CFLAGS) \
        -DVK_USE_PLATFORM_WAYLAND_KHR
 
-VULKAN_WSI_SOURCES += $(VULKAN_WSI_WAYLAND_FILES)
+VULKAN_WSI_SOURCES += \
+       $(VULKAN_WSI_WAYLAND_FILES) \
+       $(VULKAN_WSI_WAYLAND_GENERATED_FILES)
 
 VULKAN_LIB_DEPS += \
-       $(top_builddir)/src/egl/wayland/wayland-drm/libwayland-drm.la \
        $(WAYLAND_LIBS)
 endif
 
index 7510d7264ed1c70518701364ec2e4adcf1906154..63f4ac116204daf4432cdd24bfd4f6f246aa7a81 100644 (file)
@@ -7,6 +7,10 @@ VULKAN_WSI_WAYLAND_FILES := \
        wsi/wsi_common_wayland.c \
        wsi/wsi_common_wayland.h
 
+VULKAN_WSI_WAYLAND_GENERATED_FILES := \
+       wsi/wayland-drm-protocol.c \
+       wsi/wayland-drm-client-protocol.h
+
 VULKAN_WSI_X11_FILES := \
        wsi/wsi_common_x11.c \
        wsi/wsi_common_x11.h
diff --git a/src/vulkan/wsi/.gitignore b/src/vulkan/wsi/.gitignore
new file mode 100644 (file)
index 0000000..0b7b71b
--- /dev/null
@@ -0,0 +1,2 @@
+wayland-drm-client-protocol.h
+wayland-drm-protocol.c
index 67ac0b8372e80d5295ca53ce6d98d962a3dad475..2e47183b9d247730fb4f83d96664781421b71f11 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 #include <wayland-client.h>
-#include <wayland-drm-client-protocol.h>
 
 #include <assert.h>
 #include <stdlib.h>
@@ -33,6 +32,7 @@
 #include <pthread.h>
 
 #include "wsi_common_wayland.h"
+#include "wayland-drm-client-protocol.h"
 
 #include <util/hash_table.h>
 #include <util/u_vector.h>