I'm trying to use curl by creating a system library target and adding it as a dependency to my C++ target.
I can't include any of the headers, is this supported?
// swift-tools-version: 5.9
import PackageDescription
let package = Package(
name: "CxxProject",
platforms: [
.iOS(.v14),
],
products: [
.library(
name: "CxxProject",
targets: ["CxxProject"]),
],
targets: [
.systemLibrary(
name: "libcurl",
path: "Dependencies/curl",
pkgConfig: "curl",
providers: [.brew(["curl"])]),
.target(
name: "CxxProject",
dependencies: ["libcurl"]),
],
cxxLanguageStandard: .cxx14
)
Update to this, I'm now bundling an xcframework imported via .binaryTarget but I'm getting an issue with non-modular includes within curl/curl.h.
// Include of non-modular header inside framework module 'curl'
#include <limits.h>
I have (and need) the following unsafe flags. Is there a way to apply different flags to curl or link dynamically rather than statically?
.unsafeFlags(["-x", "objective-c++", "-fno-objc-arc", "-fmodules", "-fcxx-modules"]