// swift-tools-version: 5.7
//
//  Popvue's MobileVLCKit: VideoLAN's VLCKit 3.6.0 built from source without zvbi and libVLC's
//  GPL modules, so nothing in the app is GPL (Scripts/vlckit/build-vlckit.sh). The xcframework
//  is built locally and not kept in git; the app's PopvueVLCKit product links it with the
//  system frameworks it needs, the same list VideoLAN's prebuilt package linked. Until it has
//  been built on this Mac, Xcode stops at resolving packages: "local binary target
//  'MobileVLCKit' ... does not contain a binary artifact". README.md here says how to build it.
//

import PackageDescription

let package = Package(
    name: "MobileVLCKit",
    platforms: [.iOS(.v15)],
    products: [
        .library(name: "PopvueVLCKit", targets: ["PopvueVLCKit"]),
    ],
    targets: [
        .binaryTarget(name: "MobileVLCKit", path: "MobileVLCKit.xcframework"),
        .target(
            name: "PopvueVLCKit",
            dependencies: ["MobileVLCKit"],
            linkerSettings: [
                .linkedFramework("QuartzCore"),
                .linkedFramework("CoreText"),
                .linkedFramework("AVFoundation"),
                .linkedFramework("Security"),
                .linkedFramework("CFNetwork"),
                .linkedFramework("AudioToolbox"),
                .linkedFramework("OpenGLES"),
                .linkedFramework("CoreGraphics"),
                .linkedFramework("VideoToolbox"),
                .linkedFramework("CoreMedia"),
                .linkedLibrary("c++"),
                .linkedLibrary("xml2"),
                .linkedLibrary("z"),
                .linkedLibrary("bz2"),
                .linkedLibrary("iconv"),
            ]
        ),
    ]
)
