Uploaded image for project: 'Swift'
  1. Swift
  2. SR-14456

Provide a way to exclude specific headers under `include` from the module map

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Component/s: Package Manager
    • Labels:
      None

      Description

      SwiftPM allows a Clang-based target to provide a "public headers directory" which defaults to a directory named "include" if it exists in the target directory, but which can be customized in the package manifest.

      Some cross-platform source bases have "private" directories under the "include" directories. There is currently no way to exclude such headers from the module map, so any errors in such headers affect the ability to build the module map, and any private headers are vended to clients.

      The reason that the fix for this isn't always as simple as just moving the headers is that a relatively common pattern of including C source bases in packages that wrap them with Swift APIs is to use Git submodules to bring in unmodified repositories as target source directories.

      So there should be some way to control what gets included from the target's public-headers directory.

      There is an `exclude` parameter that could in theory be used, but it doesn't currently apply to the generated module map.  That would be one avenue to address this.

       

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            abertelrud Anders Bertelrud
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: