SDL: cmake: direct3d12 renderer needs d3d12.h and d3d12sdklayers.h (faa9b)

From faa9bbdc8e2d5616c725e2e963bf0618db79b002 Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Mon, 27 May 2024 02:34:26 +0200
Subject: [PATCH] cmake: direct3d12 renderer needs d3d12.h and d3d12sdklayers.h

Older MinGW releases don't ship d3d12sdklayers.h

backport of 3af4f120d0e76cfd1121713414a12aca1ac2f588

(cherry picked from commit 6c10201e5815d85b85334299b2d63d8e6c835349)
---
 CMakeLists.txt | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index cdf43a4b0ed2c..c44fa80227dc3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1809,7 +1809,12 @@ elseif(WINDOWS)
 
     check_include_file(d3d9.h HAVE_D3D_H)
     check_include_file(d3d11_1.h HAVE_D3D11_H)
-    check_include_file(d3d12.h HAVE_D3D12_H)
+    check_c_source_compiles("
+      #include <d3d12.h>
+      #include <d3d12sdklayers.h>
+      ID3D12Device1 *device;
+      int main(int argc, char **argv) {return 0; }
+      " HAVE_D3D12_H)
     check_include_file(ddraw.h HAVE_DDRAW_H)
     check_include_file(dsound.h HAVE_DSOUND_H)
     check_include_file(dinput.h HAVE_DINPUT_H)