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

Rust: Handle different rust_crate_type depending on default_library #11708

Open
xclaesse opened this issue Apr 19, 2023 · 3 comments
Open

Rust: Handle different rust_crate_type depending on default_library #11708

xclaesse opened this issue Apr 19, 2023 · 3 comments

Comments

@xclaesse
Copy link
Member

When building a C library from rust code we have to pass rust_crate_type: 'cdylib' or rust_crate_type: 'staticlib' depending if it's a shared_library() or static_library(). But in the case of both_libraries() or library() the value must be different depending on default_library option.

We probably need to add a new value rust_crate_type: 'clib' to mean cdylib if shared library, staticlib if static library.

@xclaesse
Copy link
Member Author

Note that we already handle this correctly if rust_crate_type is omitted, but it default to building Rust library rlib or dylib. This raises the question: Do we even need all possible values for rust_crate_type? rlib vs dylib and cdylib vs staticlib is something meson already knows. The only thing user needs to specify is if it's a rust or c lib.

@sdroege
Copy link
Contributor

sdroege commented Apr 19, 2023

There's also proc-macro, but that also needs a bit more special handling (e.g. #11702)

@sdroege
Copy link
Contributor

sdroege commented Apr 23, 2023

This is handled in #11714 AFAICS?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants