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

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

   .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)',
		'../CrossPlatform/Sources/Code/platform/usecase/Base/UseCaseDef.hpp',
		'../iOS/Sources/Code/XXX.h',
		'../iOS/Sources/Code/XXXX.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

I have multiple hundreds of headers, some must only be applied on specific platforms, is there any workaround that wouldn't require me to symlink (then maintain those symlinks) any time the headers change?