问题
I'm adding support for the Swift Package Manager to an Obj-C library that depends on libxml
.
I notice the Package.swift
file requires me to specify a package's URL, but what if the package is already on the system?
Here's my Package.swift
file:
import PackageDescription
let package = Package(
name: "PocketSVG",
)
If I run $ swift build
I get:
fatal error: 'libxml/xmlreader.h' file not found
回答1:
In order to use a system library, you need to provide a system module package. For more information see also Require System Libraries in the SwiftPM documentation.
As an example system module package for libxml is this one.
来源:https://stackoverflow.com/questions/42206724/swift-package-manager-for-library-that-uses-libxml