-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPackage.swift
More file actions
62 lines (56 loc) · 1.91 KB
/
Package.swift
File metadata and controls
62 lines (56 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// swift-tools-version:6.0
import PackageDescription
var cSettings: [CSetting] = [
.headerSearchPath("byedpi"),
.define("main", to: "ciadpi_main"),// bypass executable product/target type
// On iOS/macOS we need BSD sockets, not Linux-specific
.unsafeFlags([
"-UDAEMON",
"-Wno-implicit-function-declaration"
])
]
var cExclude: [String] = [
"commit-id",
"byedpi/.gitignore",
"byedpi/win_service.c",
"byedpi/win_service.h"
]
#if os(Windows)
cExclude = [
"commit-id",
"byedpi/.gitignore"
]
#endif
#if os(Linux)
cSettings.append(.define("_POSIX_C_SOURCE", to: "200809L"))
#endif
let swiftSettings: [SwiftSetting] = [
.interoperabilityMode(.C)
]
let package = Package(
name: "SwByeDPI",
platforms: [
.macOS(.v10_12), .iOS(.v10), .tvOS(.v10), .watchOS(.v3), .visionOS(.v1)
],
products: [
.library(name: "ByeDPIC", type: .static, targets: ["ByeDPIC"]),
.library(name: "ByeDPIKit", targets: ["ByeDPIKit"]),
.library(name: "SwByeDPI", targets: ["SwByeDPI"]),
],
dependencies: [],
targets: [
.target(name: "ByeDPIC", exclude: cExclude,
resources: [
.copy("PrivacyInfo.xcprivacy"),
.copy("byedpi/LICENSE")
],
publicHeadersPath: "include",
cSettings: cSettings),
.target(name: "ByeDPIKit", dependencies: ["ByeDPIC"], resources: [.copy("PrivacyInfo.xcprivacy")], swiftSettings: swiftSettings),
.target(name: "SwByeDPI", dependencies: ["ByeDPIKit"], resources: [.copy("PrivacyInfo.xcprivacy")], swiftSettings: swiftSettings),
.testTarget(name: "ByeDPIKitTests", dependencies: ["ByeDPIKit"], swiftSettings: swiftSettings),
.testTarget(name: "SwByeDPITests", dependencies: ["SwByeDPI"], swiftSettings: swiftSettings),
],
swiftLanguageVersions: [.v5, .v6],
cLanguageStandard: .c17
)