I'm reading this piece of documentation on creating CXX SPM targets. I want to specify the headers manually in a module.modulemap
file like it says I can do below the bullet points.
My Package.swift
looks like this:
// swift-tools-version:5.0
import PackageDescription
let package = Package(
name: "TBAlertController",
platforms: [
.iOS(.v8)
],
products: [
.library(name: "TBAlertController", targets: ["TBAlertController"])
],
targets: [
.target(
name: "TBAlertController",
path: "Classes"
)
]
)
And my folder structure is like so:
.
├── Classes
│ ├── TBAlertAction.h
│ ├── TBAlertAction.m
│ ├── TBAlertController.h
│ └── TBAlertController.m
├── Package.swift
├── TBAlertController.podspec
└── include
└── module.modulemap
The documentation is a little vague here… Is the include
folder supposed to go alongside the Package.swift
? Or does it go in the target path under Sources
or the one specified in the Package.swift
? (Classes/include/
)
And while I'm here… would this be the correct format for the modulemap file?
module TBAlertController [library] {
header "relative/path/to/TBAlertController.h"
header "relative/path/to/TBAlertAction.h"
export *
}