SPM header search path issue

I'm using headerSearchPath(".") to get at headers in directories other than include. Works when I run swift test. Unfortunately this doesn't end up working for a generated Xcode project because the path gets copied in as "." when it Xcode project is a few directories up.

I could chop up my project into more modules so every header is in an include directory, but that seems excessive.

Anyone know what I should do? I'm using Xcode 11.6.


I believe headerSearchPath("") works.

I have found a similar problem when using .headerSearchPath("private_include") for a private header directory of a C library. swift build will work correctly, but Xcode is unable to build the package.

When I add ./ to ensure a "local reference", it works from the command line and from Xcode.
So now I use headerSearchPath("./private_include").

Perhaps you have to use headerSearchPath("./") to convince Xcode in your case.

Terms of Service

Privacy Policy

Cookie Policy