SDL: cygwin, test/cmake: hard-code opengl as native opengl32.

From a34b35a382bffcd430465e273264021fb0f2fab1 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Sat, 16 May 2026 22:11:28 +0300
Subject: [PATCH] cygwin, test/cmake: hard-code opengl as native opengl32.

FindOpenGL from cmake >= 3.19, or cygwin-provided cmake versions don't
test for native windows opengl32, but we want native windows opengl32.
---
 test/CMakeLists.txt | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 4c5a416e61e6e..5166688ae9762 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -35,12 +35,19 @@ else()
 endif()
 set(HAVE_TESTS_LINK_SHARED "${SDL_TESTS_LINK_SHARED}" PARENT_SCOPE)
 
+if(CYGWIN)
+# FindOpenGL from cmake >= 3.19 or cygwin-provided cmake versions don't
+# test for native windows opengl32, but we want native windows opengl32.
+    set(OPENGL_gl_LIBRARY opengl32)
+    set(OPENGL_FOUND TRUE)
+else()
 # CMake incorrectly detects opengl32.lib being present on MSVC ARM64
 if(NOT (MSVC AND SDL_CPU_ARM64))
     # Prefer GLVND, if present
     set(OpenGL_GL_PREFERENCE GLVND)
     find_package(OpenGL)
 endif()
+endif()
 
 add_library(sdltests_utils OBJECT
     testutils.c