=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: build: Check VK_HEADER_VERSION.

Alexandre Julliard julliard at winehq.org
Mon Oct 29 18:00:21 CDT 2018


Module: vkd3d
Branch: master
Commit: 93676365b74b7914ede90183be90648116f8a5ed
URL:    https://source.winehq.org/git/vkd3d.git/?a=commit;h=93676365b74b7914ede90183be90648116f8a5ed

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Mon Oct 29 11:12:14 2018 +0100

build: Check VK_HEADER_VERSION.

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 configure.ac |  2 ++
 m4/vulkan.m4 | 18 ++++++++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/configure.ac b/configure.ac
index 58672c5..8c82741 100644
--- a/configure.ac
+++ b/configure.ac
@@ -61,6 +61,8 @@ AS_IF([test "x$ac_cv_header_spirv_unified1_GLSL_std_450_h" != "xyes" \
        -a "x$ac_cv_header_vulkan_GLSL_std_450_h" != "xyes"],
       [AC_MSG_ERROR([GLSL.std.450.h not found.])])
 
+VKD3D_CHECK_VULKAN_HEADER_VERSION([84], [AC_MSG_ERROR([Vulkan headers are too old, 1.1.84 is required.])])
+
 dnl Check for libraries
 m4_ifdef([PKG_PROG_PKG_CONFIG], [PKG_PROG_PKG_CONFIG], [m4_fatal([pkg-config autoconf macros not found.])])
 
diff --git a/m4/vulkan.m4 b/m4/vulkan.m4
new file mode 100644
index 0000000..6ef5818
--- /dev/null
+++ b/m4/vulkan.m4
@@ -0,0 +1,18 @@
+dnl VKD3D_CHECK_VULKAN_HEADER_VERSION
+AC_DEFUN([VKD3D_CHECK_VULKAN_HEADER_VERSION],
+
+[AS_VAR_PUSHDEF([vkd3d_vk_version], vkd3d_cv_vk_header_version_[[$1]])
+
+AC_CACHE_CHECK([whether VK_HEADER_VERSION >= [$1]], vkd3d_vk_version,
+               [AC_LINK_IFELSE(
+               [AC_LANG_SOURCE([#include <vulkan/vulkan.h>
+                               #if VK_HEADER_VERSION < $1
+                               #error "Vulkan headers are too old"
+                               #endif
+                               int main(void) { return 0; }])],
+               [AS_VAR_SET([vkd3d_vk_version], [yes])],
+               [AS_VAR_SET([vkd3d_vk_version], [no])])])
+
+AS_IF([test "x$vkd3d_vk_version" != "xyes"], [$2])
+
+AS_VAR_POPDEF([vkd3d_vk_version])])




More information about the wine-cvs mailing list