1

I want to update one library to use Swift Package Manager. Currently, it based on Carthage/Pods. But it uses libxml2 (#import ) as dependency. I have tried to add spm support but got an error this framework could not be found -> libxml/xmlreader.h

I also found some thread https://forums.swift.org/t/referring-to-libxml2-in-swift-package-description/28880/5 but seems still there is no solution. Would be great if someone can help.

swift2geek
  • 1,697
  • 1
  • 20
  • 27

1 Answers1

0

I'm happy to say that this issue has now been fixed as of Xcode 11. All you need to do is import libxml2 just as you would any other module from the SDK such as Foundation or UIKit -- no additional search paths or configuration are needed.

For C targets you can also change the import style from #import <libxml2/libxml/.h> to just #import <libxml/.h> for compatibility with the more common header layout on Linux.

swift2geek
  • 1,697
  • 1
  • 20
  • 27