|
| 1 | +// swift-tools-version:5.4 |
| 2 | + |
| 3 | +import PackageDescription |
| 4 | + |
| 5 | +let SwiftWin32 = Package( |
| 6 | + name: "SwiftWin32", |
| 7 | + products: [ |
| 8 | + .library(name: "SwiftWin32", type: .dynamic, targets: ["SwiftWin32"]), |
| 9 | + .library(name: "SwiftWin32UI", type: .dynamic, targets: ["SwiftWin32UI"]), |
| 10 | + .executable(name: "UICatalog", targets: ["UICatalog"]), |
| 11 | + .executable(name: "Calculator", targets: ["Calculator"]), |
| 12 | + ], |
| 13 | + dependencies: [ |
| 14 | + // NOTE(compnerd) require main as no current release has support for the |
| 15 | + // new CRT module. |
| 16 | + .package(url: "https://github.com/apple/swift-log.git", .branch("main")), |
| 17 | + .package(url: "https://github.com/apple/swift-collections.git", |
| 18 | + .upToNextMinor(from: "1.0.0")), |
| 19 | + .package(url: "https://github.com/compnerd/cassowary.git", .branch("main")), |
| 20 | + .package(name: "SwiftCOM", url: "https://github.com/compnerd/swift-com.git", |
| 21 | + .revision("ebbc617d3b7ba3a2023988a74bebd118deea4cc5")), |
| 22 | + ], |
| 23 | + targets: [ |
| 24 | + .target( |
| 25 | + name: "SwiftWin32", |
| 26 | + dependencies: [ |
| 27 | + .product(name: "Logging", package: "swift-log"), |
| 28 | + .product(name: "OrderedCollections", package: "swift-collections"), |
| 29 | + .product(name: "cassowary", package: "cassowary"), |
| 30 | + .product(name: "SwiftCOM", package: "SwiftCOM"), |
| 31 | + ], |
| 32 | + path: "Sources/SwiftWin32", |
| 33 | + exclude: ["CMakeLists.txt"], |
| 34 | + linkerSettings: [ |
| 35 | + .linkedLibrary("User32"), |
| 36 | + .linkedLibrary("ComCtl32"), |
| 37 | + ] |
| 38 | + ), |
| 39 | + .target( |
| 40 | + name: "SwiftWin32UI", |
| 41 | + dependencies: ["SwiftWin32"], |
| 42 | + path: "Sources/SwiftWin32UI", |
| 43 | + exclude: ["CMakeLists.txt"] |
| 44 | + ), |
| 45 | + .executableTarget( |
| 46 | + name: "Calculator", |
| 47 | + dependencies: ["SwiftWin32"], |
| 48 | + path: "Examples/Calculator", |
| 49 | + exclude: [ |
| 50 | + "CMakeLists.txt", |
| 51 | + "Calculator.exe.manifest", |
| 52 | + "Info.plist", |
| 53 | + ], |
| 54 | + swiftSettings: [.unsafeFlags(["-parse-as-library"])] |
| 55 | + ), |
| 56 | + .executableTarget( |
| 57 | + name: "UICatalog", |
| 58 | + dependencies: ["SwiftWin32"], |
| 59 | + path: "Examples/UICatalog", |
| 60 | + exclude: [ |
| 61 | + "CMakeLists.txt", |
| 62 | + "Info.plist", |
| 63 | + "UICatalog.exe.manifest", |
| 64 | + ], |
| 65 | + resources: [.copy("Assets/CoffeeCup.jpg")], |
| 66 | + swiftSettings: [.unsafeFlags(["-parse-as-library"])] |
| 67 | + ), |
| 68 | + .target(name: "TestUtilities", path: "Tests/Utilities"), |
| 69 | + .testTarget(name: "AutoLayoutTests", dependencies: ["SwiftWin32"]), |
| 70 | + .testTarget(name: "CoreGraphicsTests", dependencies: ["SwiftWin32"]), |
| 71 | + .testTarget(name: "SupportTests", dependencies: ["SwiftWin32"]), |
| 72 | + .testTarget( |
| 73 | + name: "UICoreTests", |
| 74 | + dependencies: ["SwiftWin32", "TestUtilities"] |
| 75 | + ) |
| 76 | + ] |
| 77 | +) |
0 commit comments