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.
This commit is contained in:
Ozkan Sezer 2026-05-16 22:11:28 +03:00 committed by Özkan Sezer
parent b24feafaa2
commit a34b35a382

View file

@ -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