-
Notifications
You must be signed in to change notification settings - Fork 6
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 support for library crates with multiple binaries #8
Conversation
Thanks for contributing! I didn't have time to really look at the PR (and the repo wasn't on my watchlist so i didn't get a notification), but what do you think about adding a new method like |
Sure, |
Sorry for the long delay! Writing this so you don't think we're ghosting you, there are 2 small things i wanna note already:
Anywayyy, i'll try to get back to you about the gnu stuff this week, sorry again. |
Okay soooo, I ended up replacing the resource compiler with the embed-resource crate since it has gnu/msvc and cross-platform handling, and to push it to Tauri users without a new Tauri release asap (because we released NSIS support in 1.3 and this made the experimental cross-platform compilation guide a tiny bit nicer). This change also added support for multi-binary handling, but as far as i understand it, embed-resource is not that good at handling .dll files and focuses on .exe binaries, which again is perfect for Tauri, but may not be that nice for more general uses. Sorry for making conflicting changes "behind your back" but it was really a last-minute thing we wanted to tackle :/ Thank you so much for contributing though! ❤️ |
When users have a library crate with multiple binary files, they are not able to specify metadata for a single binary, only (I believe) for all of them at once. This PR adds an optional argument
binary: Option<&str>
tocompile()
which can be used to select the binary by its' name.An example project showing how to use it has been added in
multi_binary_example
and it produces the following result:This would require a minor version bump, as it changes how the .compile() function is called.
I have only tested my changes with MSVC on Windows, GNU compiler will require additional testing.
This has been discussed in mxre#32 with mxre saying there is nothing winres can do (at that moment). You can also not have a per-binary build script (rust-lang/cargo#1430), so something like this change is required to add metadata to library+binary combo crates.