Skip to content

Commit 94e3882

Browse files
committed
freeglut: require GL/glu.h
Freeglut requires GL/glu.h, which isn't always installed. Make sure we check for it, so we can get a meaningful error message early on instead of just failing to compile. Because not all platforms has glu as a dependency, we also need to fall back to searching for the library. This search is copied from Mesa's demos project.
1 parent ba8760d commit 94e3882

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

releases.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -931,6 +931,7 @@
931931
"glut"
932932
],
933933
"versions": [
934+
"3.4.0-4",
934935
"3.4.0-3",
935936
"3.4.0-2",
936937
"3.4.0-1"

subprojects/packagefiles/freeglut/meson.build

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,29 @@ freeglut_sources = files(
6767
'src/fg_window.c',
6868
)
6969

70+
dep_glu = dependency(
71+
'glu',
72+
required: false,
73+
)
74+
# GLU is part of OpenGL.Framework
75+
if not dep_glu.found() and host_machine.system() != 'darwin'
76+
_glu_name = 'GLU'
77+
if host_machine.system() == 'windows'
78+
_glu_name = 'glu32'
79+
endif
80+
dep_glu = cc.find_library(
81+
_glu_name,
82+
has_headers: 'GL/glu.h',
83+
)
84+
endif
85+
7086
freeglut_deps = [
7187
cc.find_library(
7288
'm',
7389
required: false,
7490
),
7591
dependency('gl'),
92+
dep_glu,
7693
]
7794

7895
if host_system == 'windows'

0 commit comments

Comments
 (0)