I'm trying to add SPM support for my library. I need to define unsafeFlags for one of my library's targets (In order to import Swift code into Objective-C++):
.target(name: "MyLibrary",
dependencies: ["MyOtherTarget"],
cSettings: [
.unsafeFlags(["-fmodules", "-fcxx-modules"]),
.define("BUILDING_FOR_SPM")
]
),
The resulting package builds. But when I import it into a host app, it fails to build because
The package product 'MyLibrary' cannot be used as a dependency of this target because it uses unsafe build flags.
According to this post and the corresponding pull request, the issue was addressed in Swift 4. I'm using Xcode 12.5 and Swift 5.
So what's going on?