My Swift app accesses the USB serial port via a C++ API built as a universal dylib. When the dylib is added as a framework via "Frameworks, Libraries, and Embedded Content", it works fine. When instead the dylib is included as a binary target within an xcframework inside a Package, I get an error indicating a permissions issue.
The package looks like this:
// swift-tools-version:5.3
import PackageDescription
let package = Package(
name: "BrainFlow",
platforms: [
.macOS(.v10_14)
],
products: [
.library(
name: "BrainFlow",
targets: ["BrainFlow", "BoardController", "BrainBitLib", "DataHandler",
"GanglionLib", "MLModule", "MuseLib"])
],
dependencies: [
// Dependencies declare other packages that this package depends on.
],
targets: [
.target(
name: "BrainFlow"
),
.binaryTarget(
name: "BoardController",
path: "BoardController.xcframework"
),
.binaryTarget(
name: "BrainBitLib",
path: "BrainBitLib.xcframework"
),
.binaryTarget(
name: "DataHandler",
path: "DataHandler.xcframework"
),
.binaryTarget(
name: "GanglionLib",
path: "GanglionLib.xcframework"
),
.binaryTarget(
name: "MLModule",
path: "MLModule.xcframework"
),
.binaryTarget(
name: "MuseLib",
path: "MuseLib.xcframework"
),
.testTarget(
name: "BrainFlowTests",
dependencies: ["BrainFlow"]
)
]
)