// swift-tools-version:5.9
//
// RustPdf — Swift binding for the rust-pdf core. The native library is provided
// as a static binary xcframework, so nothing Rust is built by the consumer.
import PackageDescription

let package = Package(
    name: "RustPdf",
    platforms: [.macOS(.v11), .iOS(.v13)],
    products: [
        .library(name: "RustPdf", targets: ["RustPdf"])
    ],
    targets: [
        .binaryTarget(name: "CRustPdf", path: "RustPdfFFI.xcframework"),
        .target(
            name: "RustPdf",
            dependencies: ["CRustPdf"],
            path: "Sources/RustPdf",
            // The static Rust lib pulls in libiconv (its only non-system dep).
            linkerSettings: [.linkedLibrary("iconv")]
        )
    ]
)
