-
Notifications
You must be signed in to change notification settings - Fork 474
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
Split into .c and .h files #49
Comments
Yeah, controversial topic I know, but I'll keep sokol header-only. Some reasons:
To integrate the sokol headers into a bigger project, you would basically provide the sokol.c / sokol.m file yourself: https://github.com/floooh/sokol-samples/blob/master/sapp/sokol.c https://github.com/floooh/sokol-samples/blob/master/sapp/sokol.m Apologies for closing this issue, but this is one of those topics where both sides have valid arguments and it comes down to endlessly discussing personal preference ;) |
No worries :) Would you merge a pull request that does that ? |
Not at the moment, I need to think more about it. Right now it's not a high priority, but this might change as more headers are added. I'm aware of the merge-script approach that nuklear uses since quite recently, but I would need to figure out how to automate the merge during the edit/compile/test loop (could be done with a fips/cmake custom build step I guess). FYI, sokol_gfx.h also started in separate pieces, not C-files, but one header file per 3D-backend which was then included by the top-level sokol_gfx.h. |
when the .h file is referenced from multiple .c files, compilation performance suffers (on low-end devices: ARM, lowend x86/x64, ...) as well as IDE performance. Splitting it to .c and .h files would reduce that enormously.
PROS:
If you still have to do that, you can include one intermediate header file that include both .c and .h files
Note: Nuklear started by having a header only file, then ended up doing the split
The text was updated successfully, but these errors were encountered: