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

Support standalone code generation #2396

Merged
merged 6 commits into from
Mar 28, 2023
Merged

Support standalone code generation #2396

merged 6 commits into from
Mar 28, 2023

Conversation

kennykerr
Copy link
Collaborator

@kennykerr kennykerr commented Mar 28, 2023

@kennykerr
Copy link
Collaborator Author

Note that this PR only changes the bindgen crate. The changes to the windows and windows-sys code gen are merely whitespace differences due to limitations in rustfmt.

@poliorcetics
Copy link
Contributor

I wasn’t one of the person asking for it, but still, it looks absolutely amazing, thanks for that !

To avoid recompiling the bindings all the time when building the crate, we could add a recommandation to move them to a sub-crate only for that, for example parking_lot would introduce « parking_lot_bindings_windows » and simply save the bindings in this new crate’s lib.rs.

Are the bindings always windows-sys’ style or is it possible to have them windows’ style in the future (I’m thinking about COM APIs), with added traits and all (probably not for this MR though) ?

@djc
Copy link

djc commented Mar 28, 2023

This looks great, thanks for working on this! It would be great if, as @poliorcetics suggests, there would be a way to bring in the safe bindings at a similar level of granularity.

@kennykerr
Copy link
Collaborator Author

Yes, I just need to move some of the core types needed to support the windows-style bindings into the windows-core crate so that they can be reused without a dependency on the windows crate itself. That's a bit more work so I'll tackle that in a separate PR.

@djc
Copy link

djc commented Mar 28, 2023

Awesome, looking forward to it!

@kennykerr kennykerr merged commit 6672c6d into master Mar 28, 2023
@kennykerr kennykerr deleted the standalone branch March 28, 2023 13:55
@MarijnS95
Copy link
Contributor

👍 for having this on windows, I already suggested the same (including the mentioned windows-core split) in #1720 (comment) in hopes of having the best of both worlds: compile-times similar to windows-sys, much smaller code size than both crates, and safe(r) and more complete (COM) apis.

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.

Combating version churn
4 participants