I am trying to wrap my head around the system modules. I have the following package:
// swift-tools-version:5.4
import PackageDescription
let package = Package(
name: "SmartRV",
products: [
.executable(name: "SmartRV", targets: ["SmartRV"]),
],
dependencies: [],
targets: [
.systemLibrary(
name: "libgpiod"
),
.target(name: "SmartRV", dependencies: ["libgpiod"])
]
)
With a module defined as:
module libgpiod [system] {
header "libgpiod.h"
link "gpiod"
export *
}
However when I try to use a type from the library I am getting:
/home/scott/Projects/SmartRV/Sources/SmartRV/main.swift:4:10: error: cannot find type 'gpiod_chip' in scope
let foo: gpiod_chip
The type is defined in the header for the library.