From 2c4ae00db693b066c479150998ca618265bf9d5c Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 4 Sep 2015 19:18:50 -0700 Subject: [PATCH] vk: Conditionally compile Wayland support 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 | 6 +++++- src/vulkan/anv_wsi.c | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/vulkan/Makefile.am b/src/vulkan/Makefile.am index 014183c0f71..b2eb4fb1cb1 100644 --- a/src/vulkan/Makefile.am +++ b/src/vulkan/Makefile.am @@ -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 diff --git a/src/vulkan/anv_wsi.c b/src/vulkan/anv_wsi.c index 3778a1b20e2..21e01fc61f2 100644 --- a/src/vulkan/anv_wsi.c +++ b/src/vulkan/anv_wsi.c @@ -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); } -- 2.30.2