Replies: 2 comments 2 replies
-
Hello :) Looks like you're it doing the right way. I'm not an expert in the field of linking C libraries to Rust libraries, but your method does align with the guides written in the Rust docs: Perhaps using FYI, Rinf is using Cargokit under the hood to automatically build native Rust libraries. If I'm correct, it produces fat libraries(for multiple targets), but I think you should handle building C libraries for multiple targets manually, as you stated. |
Beta Was this translation helpful? Give feedback.
-
Finally I fixed the build after some playing with rinf and understanding the things my library needed. |
Beta Was this translation helpful? Give feedback.
-
Hello, I am trying to compile for Android a C library that needs to be compiled separately for every Android architecture.
This C library is a dependency of a rust library which in turn is also dependency of another rust library which is dependency of the hub crate.
The rust library hub is depending on has a build.rs file where I build the C library. But in order for it to properly build for Android it seems like I have to pinpoint myself the right compilers in the NDK path. This is not a problem, just I wonder if I am messing with rinf's expected behavior or usage.
Because rinf compilation for Android is creating a libhub.so file, which is a dynamic library, I cannot link in build time.
Then I am adding CMakeLists.txt file in Android for the linking.
Is there a related or different expected way to handle this situation?
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions