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.