Skip to content

freeglut: require GL/glu.h #2118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/sanity_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,10 @@ jobs:
python3 -m pip install license-expression
python3 -m pip install --pre meson
- name: Work around runner-images issue 9966
run: |
brew list -1 | grep python | while read formula; do brew unlink $formula; brew link --overwrite $formula; done
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems a bit long as a one-liner. Any reason not to keep the original formatting?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just because that's what it seemed others were doing. I don't know YAML and formatting details well enough to know if the multi-line version would work or not without testing both.

I suppose I can try and see if it helps?

- name: Sanity Checks
run: |
./tools/fake_tty.py ./tools/sanity_checks.py
1 change: 1 addition & 0 deletions releases.json
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,7 @@
"glut"
],
"versions": [
"3.4.0-4",
"3.4.0-3",
"3.4.0-2",
"3.4.0-1"
Expand Down
17 changes: 17 additions & 0 deletions subprojects/packagefiles/freeglut/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,29 @@ freeglut_sources = files(
'src/fg_window.c',
)

dep_glu = dependency(
'glu',
required: false,
)
# GLU is part of OpenGL.Framework
if not dep_glu.found() and host_machine.system() != 'darwin'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't require the dependency on macOS, then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean? Just because GLU is part of OpenGL.Framework doesn't mean Freeglut isn't useful on macOS, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you perhaps mix up GLU and GLUT?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this check include and host_machine.system() != 'darwin'? The dependency() call specifies required: false, and on macOS we don't do the followup cc.find_library() call with implicit required: true, so the wrap ends up requiring GLU except on macOS.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GLU is always required to build FreeGLUT, on all platforms.

I don't have a mac system at hand to test with, but my understanding is that on macOS, dep_glu will not be found, but because it doesn't have disabler: true, including it in freeglut_deps is benign. And on macOS, GLU will be available through dependency('gl'), which is already part of freeglut_deps.

So I'm not really sure what you think the problem is here. GLU will be found, just through another dependency on macOS.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And on macOS, GLU will be available through dependency('gl')

That answers it, thanks. Might be good to mention that in a comment, since it's not clear by inspection.

_glu_name = 'GLU'
if host_machine.system() == 'windows'
_glu_name = 'glu32'
endif
dep_glu = cc.find_library(
_glu_name,
has_headers: 'GL/glu.h',
)
endif

freeglut_deps = [
cc.find_library(
'm',
required: false,
),
dependency('gl'),
dep_glu,
]

if host_system == 'windows'
Expand Down
Loading