title: Swift sub-modules in Cocoapods
body: <p>I'm trying to set up the following arrangement of private Cocoapods:</p>
  
  <p><code>PodA</code> depends on <code>PodB</code> which depends on <code>CommonCrypto</code>.</p>
  
  <p><code>CommonCrypto</code> is a <code>dylib</code> that ships with iOS but doesn't have a <code>Swift</code> header module. Within <code>PodB</code> I've created a custom <code>module.modulemap</code> with the following contents:</p>
  
  <pre><code>module CommonCrypto [system] {
      header "/usr/include/CommonCrypto/CommonCrypto.h"
  }
  </code></pre>
  
  <p><code>PodB</code> passes the lint test (<code>pod spec lint PodB.podspec</code>) after adding the following lines:</p>
  
  <pre><code># Ensure module isn't deleted by CocoaPods
  s.preserve_paths = 'path_to/PodB/CommonCrypto'
  s.pod_target_xcconfig = { 'HEADER_SEARCH_PATHS' =&gt; '$(PODS_ROOT)/path_to/CommonCrypto' }
  </code></pre>
  
  <p>Within <code>PodA</code>, I depend on <code>PodB</code> with <code>s.dependency = 'PodB'</code>. When linting <code>PodA</code> with <code>pod spec lint --sources=myrepo PodA.podspec</code> I get an error compiling any <code>Swift</code> file with <code>import PodB</code>:</p>
  
  <pre><code>missing required module 'CommonCrypto'
  </code></pre>
  
  <p>How can I go about fixing this? It doesn't matter to me if <code>CommonCrypto</code> is private or public to <code>PodB</code>.</p>
  
  <p>I tried adding <code>export *</code> to <code>module.modulemap</code> but that made no difference.</p>