Unable to exclude specific headers from a target

SPM doesn't allow to exclude specific header from a target.
Moreover, it doesn't allow to exclude a folder with a headers from a target.

Is it possible to use ( unsafe flag? ) to exclude header?

Do you mean excluding as a public header? You control that yourself by what you place in the include directory or whatever directory you are referencing with publicHeaderPath.

It depends. For example, library can be added as submodule and I can copy only a SPM package file into a directory to use it. So, I only need to keep ( separately ) a correct version of spm file.

Moreover, if CMake wants to add a support for SPM, it may need some instructions to add only one set of files to a target. ( Yeah, it doesn't make sense at all, because all these headers are only a cosmetic change for targets and compliers know where to find correct headers even if they are not included in targets ).

This seems to be the same as https://bugs.swift.org/browse/SR-14456. I've been considering this one, and it seems to me that SwiftPM should apply any paths listed in excludes to the module map it creates for the Clang target. That should have the effect of making those headers invisible to the clients. Does that sound like a reasonable approach in this case?

1 Like
Terms of Service

Privacy Policy

Cookie Policy