My library is composed by two modules:
- The library core in Swift
- A module in C which includes CHTMLSAXParser
This is the structure
Now in order to compile it in SPM I need to create two targets:
import PackageDescription
let package = Package(
name: "MyLib",
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "MyLib",
targets: ["MyLib"]),
],
dependencies: [],
targets: [
.target(
name: "CHTMLSAXParser",
dependencies: []),
.target(
name: "MyLib",
dependencies: ["CHTMLSAXParser"])
]
)
This is pretty straightforward: in MyLib a source swift file call import CHTMLSAXParser
and everything works fine.
However I don't know what's the correct way to replicate the same behaviour with CocoaPods podspec file.
Any idea?