I'm trying to use a C library (libexif) in an SPM package, but as with any C library, it needs some refinement for Swift use. However, I can't seem to get Xcode to pick up my apinotes
file.
Package structure:
+- Package.swift
++ Sources
+++ CommandLineTarget
+- CommandLineTarget.swift
+++ LibExif
+- LibExif.h
+- LibExif.apinotes
+- module.modulemap
package.swift:
…
targets: [
.executableTarget(
name: "CommandLineTarget",
dependencies: [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
"LibExif",
]
),
.systemLibrary(
name: "LibExif",
pkgConfig: "libexif",
providers: [.brew(["libexif", "libiptcdata"])]
)
]
)
Sources/LibExif/LibExif.h
#ifndef Header_h
#define Header_h
#include <libexif/exif-data.h>
#endif /* Header_h */
Sources/LibExif/module.modulemap
module LibExif {
header "LibExif.h"
export *
}
Sources/LibExif/LibExif.apinotes
Name: LibExif
Functions:
- Name: exif_content_dump
SwiftName: 'exifContentDump(content:indent)'
- Name: exif_data_new_from_file
SwiftPrivate: true
Neither the SwiftName
nor the SwiftPrivate
annotations are picked up, so it seems LibExif.apinotes
is ignored.
Is there anything wrong with my file layout or the apinotes
file itself or is apinotes
support in SPM just broken?