Add -lGL and -lGLU to openjk_sp

Unbreaks crash when toggling fullscreen in openjk_sp (singleplayer
binary). openjk (multiplayer binary) is linked with -lGL -lGLU, but
openjk_sp lacks these flags.

see: https://github.com/JACoders/OpenJK/pull/1037

ok bcallah@ and tobhe@
This commit is contained in:
namn 2021-05-06 20:54:50 +00:00
parent 6298d55a88
commit 31f2329ab2
2 changed files with 30 additions and 1 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.12 2021/02/07 18:59:12 bcallah Exp $
# $OpenBSD: Makefile,v 1.13 2021/05/06 20:54:50 namn Exp $
# Avoid future EPOCH bumps.
COMMENT = open source reimplementation of Jedi Academy game
@ -8,6 +8,7 @@ CATEGORIES = games x11
GH_ACCOUNT = JACoders
GH_PROJECT = OpenJK
GH_COMMIT = d2ed03a016f54917bc1dcf06bcc59d3f674fb533
REVISION = 0
HOMEPAGE = https://openjk.org/
MAINTAINER = Brian Callahan <bcallah@openbsd.org>

View File

@ -0,0 +1,28 @@
$OpenBSD: patch-code_CMakeLists_txt,v 1.1 2021/05/06 20:54:50 namn Exp $
Add -lGL and -lGLU to openjk_sp
see: https://github.com/JACoders/OpenJK/pull/1037
Unbreaks crash when toggling fullscreen in the singleplayer binary on
OpenBSD. openjk (multiplayer binary) uses -lGL and -lGLU but openjk_sp
did not.
Index: code/CMakeLists.txt
--- code/CMakeLists.txt.orig
+++ code/CMakeLists.txt
@@ -46,6 +46,14 @@ if(BuildSPEngine OR BuildJK2SPEngine)
"${GSLIncludeDirectory}")
# Dependencies
+
+ if (NOT WIN32)
+ # OpenGL
+ find_package(OpenGL REQUIRED)
+ set(SPEngineIncludeDirectories ${SPEngineIncludeDirectories} ${OPENGL_INCLUDE_DIR})
+ set(SPEngineLibraries ${SPEngineLibraries} ${OPENGL_LIBRARIES})
+ endif()
+
# OpenAL (is optionally included for Windows)
if(MSVC AND NOT WIN64)
if(UseInternalOpenAL)