title: Why does the last platform-specific dependency take precedence in Cargo?
body: <p>I have a dependency in my Cargo file that needs to be different by platform, specifically, the default features. Here's what I am trying to do:</p>
  
  <pre><code>[package]
  name = "..blah.."
  version = "..blah.."
  authors = ["..blah.."]
  
  [target.'cfg(target_os = "macos")'.dependencies]
  hyper = { version = "0.9", default-features = false, features = ["security-framework"] }
  
  [target.'cfg(target_os = "linux")'.dependencies]
  hyper = { version = "0.9", default-features = true }
  </code></pre>
  
  <p>But this doesn't seem to do what I want. On my Mac it appears to be using the bottom target line as if I just specified <code>hyper = "0.9"</code>. If I do <code>cargo build</code> as specified, I get errors with regard to openssl:</p>
  
  <blockquote>
    <p>cargo:warning=#include &lt;openssl/ssl.h&gt;</p>
  </blockquote>
  
  <p>However, if I build it like this:</p>
  
  <pre><code>[dependencies]
  hyper = { version = "0.9", default-features = false, features = ["security-framework"] }
  </code></pre>
  
  <p>Then it builds fine. This indicates to me that the <code>cfg</code> for "macos" isn't working.</p>
  
  <p>How do I make this work, or more specifically, how do I solve the problem where I need my dependency to use different features by platform?</p>