SDL: cmake: testffmpeg requires link to EGL library for EGL feature

From 0a961915dc2379aa9c28db02e160314584b4c305 Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Tue, 27 Feb 2024 12:28:06 +0100
Subject: [PATCH] cmake: testffmpeg requires link to EGL library for EGL
 feature

---
 test/CMakeLists.txt | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index e7c12e30cb60..d09c81e0666f 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -232,12 +232,10 @@ if(FFmpeg_FOUND AND LIBAVUTIL_AVFRAME_HAS_CH_LAYOUT)
     if(APPLE)
         target_link_options(testffmpeg PRIVATE "-Wl,-framework,CoreVideo")
     endif()
-    if(HAVE_OPENGLES_V2)
+    if(TARGET OpenGL::EGL)
         message(DEBUG "Enabling EGL support in testffmpeg")
+        target_link_libraries(testffmpeg PRIVATE OpenGL::EGL)
         target_compile_definitions(testffmpeg PRIVATE HAVE_EGL)
-        if(TARGET OpenGL::EGL)
-            target_link_libraries(testffmpeg PRIVATE OpenGL::EGL)
-        endif()
     endif()
     target_link_libraries(testffmpeg PRIVATE ${FFMPEG_LIBRARIES})
 else()