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

[build] only include rglfw.c for glfw platform #4864

Merged
merged 1 commit into from
Mar 27, 2025

Conversation

marler8997
Copy link
Contributor

It looks like raylib doesn't require rglfw.c if you're using the RGFW backend. I'm guessing the same is true for SDL but I haven't tested. Excluding this one file brings the raylib library down from 6.9 MB to 6.3 MB for RGFW.

However, one of the examples requires the symbols from rglfw.c, to accomodate this I added a function that will check whether raylib has already included rglfw and if not include it for that one example.

It looks like raylib doesn't require rglfw.c if you're using the RGFW
backend.  I'm guessing the same is true for SDL but I haven't tested.
Excluding this one file brings the raylib library down from 6.9 MB to
6.3 MB for RGFW.

However, one of the examples requires the symbols from rglfw.c,
to accomodate this I added a function that will check whether raylib has
already included rglfw and if not include it for that one example.
@raysan5 raysan5 merged commit 44f4400 into raysan5:master Mar 27, 2025
2 checks passed
@raysan5
Copy link
Owner

raysan5 commented Mar 27, 2025

@marler8997 Oh! Good catch! Still, 6.3MB seems quite big to me, libraylib.a compiled with w64devkit for PLATFORM_DESKTOP with GLFW is about 2MB for me.

@marler8997 marler8997 deleted the excludeRglfw branch March 27, 2025 08:03
@marler8997
Copy link
Contributor Author

Ah, might be because that's a debug build. I get 1.8 MB for a ReleaseSmall build via zig. Looks like a ReleaseFast build jumps back up to 6.7 MB though. A bit surprising ReleaseSmall is so much smaller.

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