Search path on Xcode 11 and Swift Package

I develop a package with Xcode 11, which depends on libxml2.


Xcode 11 told me `Could not build Objective-C module 'libxml2'`.


But use `swift build -Xcc -I"$SDKROOT/usr/include/libxml2"` has no problem.


I wonder how to set search path for Swift package on Xcode 11?

Accepted Reply

Answer to myself:


use `swift package generate-xcodeproj` to generate Xcode proj, and use it as workspace. Then you can specific header search path in build settings.

Replies

Answer to myself:


use `swift package generate-xcodeproj` to generate Xcode proj, and use it as workspace. Then you can specific header search path in build settings.

Can you speak more in detail? I also got this error.

Check out here:


https://github.com/cxa/XPaver/blob/master/Package.swift#L23-L24