meson: verify that d3d12.h exists when building the d3d12 driver
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Thu, 12 Nov 2020 14:16:46 +0000 (15:16 +0100)
committerMarge Bot <eric+marge@anholt.net>
Fri, 13 Nov 2020 08:40:52 +0000 (08:40 +0000)
Without this header-file, we can't build the driver. So let's verify
that it exists, and can be used by the C++ compiler.

This should make it a bit more clear what's wrong if someone attempts to
build this using MinGW or on Linux.

Fixes: 2ea15cd661c ("d3d12: introduce d3d12 gallium driver")
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7575>

meson.build

index 9bebca0..807efa0 100644 (file)
@@ -566,6 +566,10 @@ if with_gallium_zink
   dep_vulkan = dependency('vulkan')
 endif
 
+if with_gallium_d3d12 and not cpp.check_header('d3d12.h')
+  error('The D3D12 driver requires d3d12.h from the Windows SDK')
+endif
+
 if with_vulkan_overlay_layer or with_aco_tests
   prog_glslang = find_program('glslangValidator')
 endif