You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Currently, I am facing the same issue. I am trying to wrap a git submodule (to reduce further maintenance when the original c library changes), but I am forced to delete header files that should not be included in swift (e.g. tests). Has anyone found a suitable workaround yet?
Currently I have the same issue when importing https://github.com/KhronosGroup/SPIRV-Cross. I am trying to exclude include directory in Package.swift, but SPM still looks into this folder.
Additional Detail from JIRA
md5: 2843d28fab96433cad396861be17a332
Issue 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.
The text was updated successfully, but these errors were encountered: