SPM, How do we define multiple public header path?

In Swift Package Manager, we only can define a single public search path:

The path to the directory containing public headers of a C-family target.

            name: "iOS",
            dependencies: ["fmt"],
            publicHeadersPath: "include")

But in many cases, our public headers are not in the same directory。

In GYP ( Generate Your Projects), we can accomplish this by:

       'mac_framework_headers': [
                '<!@(python ../script/glob.py ../iOS/Sources/Generation *.h)',

So how do we expose these headers together in SPM? Thanks a lot.

The best workaround I've found for this is to use symbolic links from the directory in publicHeadersPath to the other headers.

1 Like