SDL: cmake: fix SDL_RENDER_VULKAN reporting

From 1f536a1e7799ce44e5e1fb2e41e5fb543435fce7 Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Mon, 26 Feb 2024 20:37:07 +0100
Subject: [PATCH] cmake: fix SDL_RENDER_VULKAN reporting

Also fix an error when configuring with `-DSDL_VULKAN=ON
-DSDL_RENDER_VULKAN=FALSE`: the vulkan renderer is now correctly
disabled.
---
 CMakeLists.txt        | 2 ++
 cmake/sdlchecks.cmake | 5 ++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f504f933f834..8f3bd5e27192 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2010,6 +2010,7 @@ elseif(WINDOWS)
       set(HAVE_VULKAN TRUE)
       if(SDL_RENDER_VULKAN)
         set(SDL_VIDEO_RENDER_VULKAN 1)
+        set(HAVE_RENDER_VULKAN TRUE)
       endif()
     endif()
   endif()
@@ -2254,6 +2255,7 @@ elseif(APPLE)
           set(HAVE_VULKAN TRUE)
           if(SDL_RENDER_VULKAN)
             set(SDL_VIDEO_RENDER_VULKAN 1)
+            set(HAVE_RENDER_VULKAN TRUE)
           endif()
         endif()
         if(SDL_METAL)
diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake
index 4cf36f3e8a30..7fae2524b4e1 100644
--- a/cmake/sdlchecks.cmake
+++ b/cmake/sdlchecks.cmake
@@ -725,7 +725,10 @@ macro(CheckVulkan)
   if(SDL_VULKAN)
     set(SDL_VIDEO_VULKAN 1)
     set(HAVE_VULKAN TRUE)
-    set(SDL_VIDEO_RENDER_VULKAN 1)
+    if(SDL_RENDER_VULKAN)
+      set(SDL_VIDEO_RENDER_VULKAN 1)
+      set(HAVE_RENDER_VULKAN TRUE)
+    endif()
   endif()
 endmacro()