CMake: Link with correct OpenGL library (fixes #1872)

This commit is contained in:
Vicki Pfau 2020-11-24 01:25:38 -08:00
parent d01190bf90
commit 6ca62fae83
2 changed files with 4 additions and 0 deletions

View File

@ -53,6 +53,7 @@ Other fixes:
- 3DS: Fix thread cleanup
- All: Improve export headers (fixes mgba.io/i/1738)
- CMake: Fix build with downstream minizip that exports incompatible symbols
- CMake: Link with correct OpenGL library (fixes mgba.io/i/1872)
- Core: Ensure ELF regions can be written before trying
- Core: Fix threading improperly setting paused state while interrupted
- Debugger: Don't skip undefined instructions when debugger attached

View File

@ -6,6 +6,7 @@ if(POLICY CMP0025)
endif()
if(POLICY CMP0072)
cmake_policy(SET CMP0072 NEW)
set(OpenGL_GL_PREFERENCE LEGACY)
endif()
project(mGBA)
set(BINARY_NAME mgba CACHE INTERNAL "Name of output binaries")
@ -436,6 +437,8 @@ if(BUILD_GL)
find_package(OpenGL QUIET)
if(NOT OPENGL_FOUND)
set(BUILD_GL OFF CACHE BOOL "OpenGL not found" FORCE)
elseif(TARGET OpenGL::GL)
set(OPENGL_LIBRARY OpenGL::GL)
endif()
endif()
if(NOT BUILD_GL)