Uh oh!
There was an error while loading. Please reload this page.
Parametrize dlopen feature names - #13
Conversation
twilligon
commented
Feb 22, 2021
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 |
elinorbgr
left a comment
There was a problem hiding this comment.
Looks good overall, just two points. Thanks a lot for having taken the time to update the Readme as well!
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
twilligon
commented
Feb 22, 2021
The way I've written ffi_dispatch it'll only work on rust 1.43 and up, is that OK? |
This is useful for robustness, if someone imports just one macro from dlib that ends up trying to call another.
Uh oh!
There was an error while loading. Please reload this page.
elinorbgr
commented
Feb 23, 2021
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? |
twilligon
commented
Feb 24, 2021
I take it back, the existing cfg statements work fine. It's if statements that don't work in rust 1.41. |
elinorbgr
left a comment
There was a problem hiding this comment.
Alright, looks pretty good, thanks!
twilligon
commented
Feb 24, 2021
Thanks. Could you cut a new release (say |
elinorbgr
commented
Feb 25, 2021
Yes, I'm just preparing some cosmetic additions before the release, I'll release it soon. |
elinorbgr
commented
Feb 25, 2021
|
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
dlopenfeature on dlib. For example, in this snippet, the library is linked at build time if thedlopen-foofeature is disabled on the crate it resides in:See the README for more information, and also Smithay/client-toolkit#178 for context.