title: Manually specifying include directory for Swift C module
body: <p>I have a C library <code>MyLib</code> that I am trying to use in a Swift app. I want to use a local copy of the library, so I don't want to install it or add my bridge header to its files. I clone the library to <code>Sources/ClibMyLib/MyLib</code> so the package structure looks like this:</p>
  <pre><code>App
    | Package.swift
    | Sources/
      | ClibMyLib/
        | module.modulemap
        | bridge.h
        | MyLib/
          | include/
            | myLibHeader.h
          | source/
            | *.c
  </code></pre>
  <p>I specify <code>bridge.h</code> as the header in the module map:</p>
  <pre><code>module ClibMyLib {
      umbrella header &quot;bridge.h&quot;
      link &quot;MyLib&quot;
      export *
  }
  </code></pre>
  <p>The problem is that the <code>include</code> directory of <code>MyLib</code> is not visible to <code>bridge.h</code> So if <code>bridge.h</code> looks like this:</p>
  <pre><code>#include &quot;myLibHeader.h&quot;
  </code></pre>
  <p>it fails to build since it can't find <code>myLibHeader.h</code>. If I specify the path from <code>bridge.h</code> to the local copy like this:</p>
  <pre><code>#include &quot;MyLib/include/myLibHeader.h&quot;
  </code></pre>
  <p>then any transitive includes in <code>myLibHeader.h</code> still fail.</p>
  <p>This would be very easy to solve in a C build, I would just add <code>MyLib/include</code> as an include directory. I haven't been able to find a way to do something similar in Swift - most guides I have found install the library and include from <code>/usr/local/include/</code>.</p>
  <p>Are my only options to place <code>bridge.h</code> in the library's include directory or to install the headers to <code>/usr/local/include</code>? Adding <code>bridge.h</code> to the library is not ideal, the include directory file structure is more complicated than the simple example I gave. I just want to be able to manually specify an include directory.</p>