// swift-tools-version: 5.9

import PackageDescription

// Path to the Rust static library built by `cargo build --release`
let rustLibPath = "../target/release"

let package = Package(
    name: "CalcPad",
    platforms: [
        .macOS(.v14)
    ],
    targets: [
        .systemLibrary(
            name: "CCalcPadEngine",
            path: "Sources/CCalcPadEngine"
        ),
        .executableTarget(
            name: "CalcPad",
            dependencies: ["CCalcPadEngine"],
            path: "Sources/CalcPad",
            linkerSettings: [
                .unsafeFlags(["-L\(rustLibPath)"]),
                .linkedLibrary("calcpad_engine"),
            ]
        ),
        .testTarget(
            name: "CalcPadTests",
            dependencies: ["CalcPad"],
            path: "Tests/CalcPadTests",
            linkerSettings: [
                .unsafeFlags(["-L\(rustLibPath)"]),
                .linkedLibrary("calcpad_engine"),
            ]
        ),
    ]
)
