SDL: cmake: Do a more thorough test for the old bcm Raspberry Pi libraries.

From 7967c97618fba7326028005e72ead740fa6e6589 Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Wed, 5 Jan 2022 21:02:38 -0500
Subject: [PATCH] cmake: Do a more thorough test for the old bcm Raspberry Pi
 libraries.

Fixes #5132.
---
 cmake/sdlchecks.cmake | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake
index d23d4b8b994..a5c0ec1a9e5 100644
--- a/cmake/sdlchecks.cmake
+++ b/cmake/sdlchecks.cmake
@@ -1221,7 +1221,11 @@ macro(CheckRPI)
     set(CMAKE_REQUIRED_LIBRARIES "${VIDEO_RPI_LIBRARIES}")
     check_c_source_compiles("
         #include <bcm_host.h>
-        int main(int argc, char **argv) {}" HAVE_RPI)
+        #include <EGL/eglplatform.h>
+        int main(int argc, char **argv) {
+          EGL_DISPMANX_WINDOW_T window;
+          bcm_host_init();
+        }" HAVE_RPI)
     set(CMAKE_REQUIRED_FLAGS "${ORIG_CMAKE_REQUIRED_FLAGS}")
     set(CMAKE_REQUIRED_LIBRARIES)