Skip to content

Commit

Permalink
Simplify Package.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
stevapple authored and milseman committed Aug 5, 2021
1 parent 58a2725 commit 39774ef
Showing 1 changed file with 22 additions and 29 deletions.
51 changes: 22 additions & 29 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,32 @@

import PackageDescription

var windowsPlatform: [Platform] = []
#if os(Windows)
windowsPlatform.append(.windows)
#endif

let targets: [Target] = [
.target(
name: "SystemPackage",
dependencies: ["CSystem"],
path: "Sources/System",
cSettings: [
.define("_CRT_SECURE_NO_WARNINGS", .when(platforms: windowsPlatform)),
],
swiftSettings: [
.define("SYSTEM_PACKAGE"),
.define("ENABLE_MOCKING", .when(configuration: .debug))
]),
.target(
name: "CSystem",
dependencies: []),
.testTarget(
name: "SystemTests",
dependencies: ["SystemPackage"],
swiftSettings: [
.define("SYSTEM_PACKAGE")
]),
]

let package = Package(
name: "swift-system",
products: [
.library(name: "SystemPackage", targets: ["SystemPackage"]),
],
dependencies: [],
targets: targets
targets: [
.target(
name: "CSystem",
dependencies: []),
.target(
name: "SystemPackage",
dependencies: ["CSystem"],
path: "Sources/System",
cSettings: [
.define("_CRT_SECURE_NO_WARNINGS")
],
swiftSettings: [
.define("SYSTEM_PACKAGE"),
.define("ENABLE_MOCKING", .when(configuration: .debug))
]),
.testTarget(
name: "SystemTests",
dependencies: ["SystemPackage"],
swiftSettings: [
.define("SYSTEM_PACKAGE")
]),
]
)

0 comments on commit 39774ef

Please sign in to comment.