/*
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

// swift-tools-version: 6.1
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
    name: "React-GeneratedCode",
    platforms: [.iOS(.v15), .macCatalyst(SupportedPlatform.MacCatalystVersion.v13)],
    products: [
        // Products define the executables and libraries a package produces, making them visible to other packages.
        .library(
            name: "ReactCodegen",
            targets: ["ReactCodegen"]),
        .library(
            name: "ReactAppDependencyProvider",
            targets: ["ReactAppDependencyProvider"]),
    ],
    dependencies: [
      .package(name: "React", path: "../../../../../../../../../../../../../node_modules/react-native")
    ],
    targets: [
        // Targets are the basic building blocks of a package, defining a module or a test suite.
        // Targets can depend on other targets in this package and products from dependencies.
        .target(
            name: "ReactCodegen",
            dependencies: ["React"],
            path: "ReactCodegen",
            exclude: ["ReactCodegen.podspec"],
            publicHeadersPath: ".",
            cSettings: [
              .headerSearchPath("headers")
            ],
            cxxSettings: [
              .headerSearchPath("headers"),
              .unsafeFlags(["-std=c++20"]),
            ],
            linkerSettings: [
              .linkedFramework("Foundation")
            ]
        ),
        .target(
          name: "ReactAppDependencyProvider",
          dependencies: ["ReactCodegen"],
          path: "ReactAppDependencyProvider",
          exclude: ["ReactAppDependencyProvider.podspec"],
          publicHeadersPath: ".",
          cSettings: [
            .headerSearchPath("headers"),
          ],
          cxxSettings: [
            .headerSearchPath("headers"),
            .unsafeFlags(["-std=c++20"]),
          ],
          linkerSettings: [
            .linkedFramework("Foundation")
          ]
        )
    ]
)
