Skip to content
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

Add glbinding #974

Merged
merged 3 commits into from
Apr 21, 2023
Merged

Add glbinding #974

merged 3 commits into from
Apr 21, 2023

Conversation

v1993
Copy link
Contributor

@v1993 v1993 commented Apr 8, 2023

Add https://github.com/cginternals/glbinding - a C++ OpenGL binding/loader with enhanced type safety. Includes glbinding-aux library, which is not built by default.

Upstream relies on CMake-generated headers that are far too complex to reproduce nicely with meson, so I've bundled them and tweaked where needed.

I'm not quite sure about tests - it's an OpenGL library, so I doubt CI will manage to run them.

@v1993 v1993 force-pushed the glbinding branch 2 times, most recently from e12dcdb to b6f9610 Compare April 8, 2023 07:42
@v1993
Copy link
Contributor Author

v1993 commented Apr 8, 2023

Checks keep failing due to unauthorized files, even though I've added them to script as exceptions. I guess CI runs script from master branch instead of PR?

Also, MSVC emits a truly ridiculous amount of warning C4251, but it doesn't seem to be our fault.

@neheb
Copy link
Collaborator

neheb commented Apr 10, 2023

The entries in sanity_checks.py need to have the subdir.

@v1993
Copy link
Contributor Author

v1993 commented Apr 10, 2023

The entries in sanity_checks.py need to have the subdir.

Does it? None of existing entries include subdirectory and some of them (e.g. box2d) have files stored in one.

EDIT: Figured it out, I forgot commas... so much for implicit concatenation!

@v1993
Copy link
Contributor Author

v1993 commented Apr 10, 2023

@neheb Test suite is passing now. This should be ready to merge.

@v1993
Copy link
Contributor Author

v1993 commented Apr 10, 2023

Fixed issues pointed out by review.

@v1993 v1993 force-pushed the glbinding branch 2 times, most recently from e6b5adc to 355973c Compare April 10, 2023 02:29
@v1993

This comment was marked as resolved.

@v1993 v1993 force-pushed the glbinding branch 2 times, most recently from b7f4b20 to 52408bb Compare April 10, 2023 07:09
@@ -0,0 +1 @@
#include <glbinding/Binding.h>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

About this file...

Upstream has its own precompiled header - which is why I've decided to make use of this feature in the first place. However, that header is included by other files (which meson docs warns not to do, although it doesn't seem to break in practice) and has a #pragma once guard, which produces a compiler warning.

As for build time - there's a clear benefit, reducing it from ~47 seconds to ~36 seconds on my machine.

@neheb
Copy link
Collaborator

neheb commented Apr 20, 2023

Please rebase to current master

@v1993
Copy link
Contributor Author

v1993 commented Apr 20, 2023

cc1plus.exe: out of memory allocating 69631 bytes

So, what now?

@neheb
Copy link
Collaborator

neheb commented Apr 21, 2023

I’d squash some of these commits. That’s a hilarious error. Wonder if it can be worked around.

@v1993 v1993 force-pushed the glbinding branch 3 times, most recently from cb8d475 to b42af69 Compare April 21, 2023 06:14
v1993 added 3 commits April 21, 2023 09:20
Upstream relies on CMake-generated headers that are far too complex to reproduce nicely with meson, so I've bundled them and tweaked where needed.
This is useful when accounting for system-wide installation, since that has both libraries as CMake targets:

```
glbinding = dependency('glbinding', method: 'cmake', modules: ['glbinding::glbinding', 'glbinding::glbinding-aux'], default_options: ['main_glbinding_includes_aux=true'])
```
By default, tests are compiled but not run. This is because they don't work in headless environment like CI.
@v1993
Copy link
Contributor Author

v1993 commented Apr 21, 2023

Looks like tests have succeeded on MSYS2-UCRT64 by sheer luck this time. I haven't changed anything significant, only rearranged changes around commits.

If anyone is curious, here's the most likely monstrosity of a file causing compiler to run out of memory.

@neheb
Copy link
Collaborator

neheb commented Apr 21, 2023

That is indeed a monstrosity. Cool that it works now.

@neheb neheb merged commit 5dd0e0a into mesonbuild:master Apr 21, 2023
@v1993 v1993 deleted the glbinding branch April 24, 2023 03:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants