-
Notifications
You must be signed in to change notification settings - Fork 9
Parametrize dlopen feature names #13
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
Parametrize dlopen feature names #13
Conversation
BTW, I tested building smithay-client-toolkit and wayland-rs against this branch and it works fine. This keeps the old behavior (dlopen-ing everything) when |
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 good overall, just two points. Thanks a lot for having taken the time to update the Readme as well!
The way I've written ffi_dispatch it'll only work on rust 1.43 and up, is that OK? |
69d708a
to
f36bca1
Compare
This is useful for robustness, if someone imports just one macro from dlib that ends up trying to call another.
287586b
to
fa1e778
Compare
It is due to the cfg attributes on statements? Can't we push that further by introducing blocks, like so:
IIRC this is accepted by older compilers as well, no? |
I take it back, the existing cfg statements work fine. It's if statements that don't work in rust 1.41. |
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.
Alright, looks pretty good, thanks!
Thanks. Could you cut a new release (say |
Yes, I'm just preparing some cosmetic additions before the release, I'll release it soon. |
|
This PR adds an argument to the beginning of dlib's macros which specifies the name of the feature that switches between dlopen and linking the library at build time. In this branch, the specified feature lives on the crate using dlib, which means crates no longer have to enable the
dlopen
feature on dlib. For example, in this snippet, the library is linked at build time if thedlopen-foo
feature is disabled on the crate it resides in:See the README for more information, and also Smithay/client-toolkit#178 for context.