title: Rust cargo dylib clarification
body: <p>I have a Rust project that I want to embed in another application as a dylib. I have <code>crate_type = ["dylib"]</code> set in my <code>Cargo.toml</code>, but I'm not sure if this should be <code>cdylib</code> instead. </p>
  
  <p>When I build the project, it produces a <code>libfoo.dylib</code> in <code>target/debug</code> as expected, but looking at <code>otool -L</code> it also links against a <code>libfoo.dylib</code> in <code>target/debug/deps/</code>. If I'm going to be using this in another application, will I have to provide both dylibs?</p>
  
  <p>Also, when the crate type is <code>cdylib</code>, 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.</p>
  
  <p>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? </p>
  
  <p>I'm using Rust on macOS 10.12 if that's significant</p>