swift package manager for library that uses libxml

≯℡__Kan透↙ 提交于 2019-12-12 01:42:36

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!