-
-
Notifications
You must be signed in to change notification settings - Fork 97
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 CRATE_TYPES argument for corrosion_import_crate #269
Support CRATE_TYPES argument for corrosion_import_crate #269
Conversation
4e1097d
to
f84e33e
Compare
Do you have a real-world usecase where the overhead of building the additional lib type is significant and a bottleneck? |
In my case, shared lib is failed to build (for some reason, it tries to link with |
The request itself is reasonable, however it would be a breaking change and it is quite likely that there are users relying on cdylibs always being built (thats also why the tests are failing here). I'll have to think about if we can support this without breaking existing users. |
What do you think about the solution with introducing an option to |
I guess we could do that. Though I would suggest |
f84e33e
to
82ea215
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks mostly good. I left some comments which should be addressed.
Also it would be good if you could add a description of the parameter to the Readme, and also note that the parameter currently only works with CMake >= 3.19.
82ea215
to
33fc58c
Compare
Looks good to me. Could you rebase and squash? |
2b2ddb0
to
586c543
Compare
Consider we have
Cargo.toml
withcrate-type = ["staticlib", "cdylib"]
, but you need to build and use only one of them.Editing of
Cargo.toml
is not an option (e.g., because it's in a third-party library).Right now, you can't specify which type to use (adding a such option to
corrosion_import_crate
was my first thought).But actually, you can set
FLAGS --crate-type=staticlib
, so*.so
file won't be tried to build. Then, the only setback iscopy_if_different
still would try to copy the file. So, as suggested in this PR, we can probably operate only with files corresponding to the currentBUILD_SHARED_LIBS
settings.Any feedback will be appreciated!