// swift-tools-version: 5.9

import PackageDescription

let package = Package(
	name: "CavesOfJolk-Swift",
    platforms: [
		.macOS(.v11)
	],
	products: [
		.executable(name: "Test", targets: ["Test"]),
		.library(name: "JolkEngine", targets: ["JolkEngine"])
	],
	dependencies: [
		.package(
			url: "https://github.com/ctreffs/SwiftSDL2.git",
			.upToNextMajor(from: "1.4.1")),
		.package(
			url: "https://github.com/apple/swift-collections.git",
			.upToNextMinor(from: "1.1.0"))
	],
	targets: [
		.executableTarget(
			name: "Test",
			dependencies: [ .target(name: "JolkEngine") ],
			resources: [ .process("Resources") ]
		),
		.target(
			name: "JolkEngine",
			dependencies: [
				.product(name: "SDL", package: "SwiftSDL2"),
				.product(name: "Collections", package: "swift-collections"),
				"HSLuv"
			],
			swiftSettings: [
				.unsafeFlags(["-Xcc", "-DGL_SILENCE_DEPRECATION"])
			]
		),
		.target(name: "HSLuv"),
	]
)
