I have a Rust project that I want to embed in another application as a dylib. I have crate_type = ["dylib"] set in my Cargo.toml, but I'm not sure if this should be cdylib instead.
When I build the project, it produces a libfoo.dylib in target/debug as expected, but looking at otool -L it also links against a libfoo.dylib in target/debug/deps/. If I'm going to be using this in another application, will I have to provide both dylibs?
Also, when the crate type is cdylib, it'll produce two dylibs as well but the one in deps will have a hash tacked onto the end of the filename. I'm not sure what the difference between these two crate types are.
I can avoid getting two dylibs by using just rustc, however I'd like to use cargo. What is the recommended way of going about embedding Rust as a dylib in other applications?
I'm using Rust on macOS 10.12 if that's significant