vk: Conditionally compile Wayland support
authorJason Ekstrand <jason.ekstrand@intel.com>
Sat, 5 Sep 2015 02:18:50 +0000 (19:18 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Sat, 5 Sep 2015 02:18:52 +0000 (19:18 -0700)
Pulling in libwayland causes undefined symbols in applications that are
linked against vulkan alone.  Ideally, we would like to dlopen a platform
support library or something like that.  For now, this works and should get
crucible running again.

src/vulkan/Makefile.am
src/vulkan/anv_wsi.c

index 014183c0f716d67a514732e7a9c1e0e1578db72c..b2eb4fb1cb187427a8dd4c43b8bf11fb9badd8cb 100644 (file)
@@ -75,7 +75,6 @@ VULKAN_SOURCES =                                        \
        anv_query.c                                     \
        anv_util.c                                      \
        anv_wsi.c                                       \
-       anv_wsi_wayland.c                               \
        anv_wsi_x11.c                                   \
        gen8_state.c                                    \
        gen8_cmd_buffer.c                               \
@@ -84,6 +83,11 @@ VULKAN_SOURCES =                                        \
        gen7_cmd_buffer.c                               \
        gen7_pipeline.c
 
+if HAVE_EGL_PLATFORM_WAYLAND
+VULKAN_SOURCES += anv_wsi_wayland.c
+libvulkan_la_CFLAGS += -DHAVE_WAYLAND_PLATFORM
+endif
+
 libvulkan_la_SOURCES =                                  \
        $(VULKAN_SOURCES)                               \
        anv_gem.c
index 3778a1b20e275dec649157fc78949a9b41eb3d3f..21e01fc61f2fa886a9740eeadd8f65fd0a09dfa9 100644 (file)
@@ -34,11 +34,13 @@ anv_init_wsi(struct anv_instance *instance)
    if (result != VK_SUCCESS)
       return result;
 
+#ifdef HAVE_WAYLAND_PLATFORM
    result = anv_wl_init_wsi(instance);
    if (result != VK_SUCCESS) {
       anv_x11_finish_wsi(instance);
       return result;
    }
+#endif
 
    return VK_SUCCESS;
 }
@@ -46,7 +48,9 @@ anv_init_wsi(struct anv_instance *instance)
 void
 anv_finish_wsi(struct anv_instance *instance)
 {
+#ifdef HAVE_WAYLAND_PLATFORM
    anv_wl_finish_wsi(instance);
+#endif
    anv_x11_finish_wsi(instance);
 }