-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathPackage.swift
More file actions
99 lines (97 loc) · 3.86 KB
/
Copy pathPackage.swift
File metadata and controls
99 lines (97 loc) · 3.86 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
// 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: "YYJSON",
platforms: [
.macOS(.v10_15),
.iOS(.v13),
.tvOS(.v13),
.watchOS(.v6),
.visionOS(.v1),
],
products: [
.library(
name: "YYJSON",
targets: ["YYJSON"]
)
],
traits: [
.trait(name: "noReader", description: "Omit JSON reader"),
.trait(name: "noWriter", description: "Omit JSON writer"),
.trait(name: "noIncrementalReader", description: "Omit incremental reader"),
.trait(name: "noUtilities", description: "Omit JSON Pointer, Patch, Merge Patch"),
.trait(
name: "noFastFloatingPoint",
description: "Use libc strtod/snprintf"
),
.trait(
name: "strictStandardJSON",
description: "Disable non-standard JSON features"
),
.trait(
name: "noUTF8Validation",
description: "Skip UTF-8 validation"
),
],
targets: [
.target(
name: "Cyyjson",
path: "Sources/Cyyjson",
sources: ["yyjson.c"],
publicHeadersPath: ".",
cSettings: [
.define("YYJSON_DISABLE_READER", to: "1", .when(traits: ["noReader"])),
.define("YYJSON_DISABLE_WRITER", to: "1", .when(traits: ["noWriter"])),
.define(
"YYJSON_DISABLE_INCR_READER",
to: "1",
.when(traits: ["noIncrementalReader"])
),
.define("YYJSON_DISABLE_UTILS", to: "1", .when(traits: ["noUtilities"])),
.define(
"YYJSON_DISABLE_FAST_FP_CONV",
to: "1",
.when(traits: ["noFastFloatingPoint"])
),
.define(
"YYJSON_DISABLE_NON_STANDARD",
to: "1",
.when(traits: ["strictStandardJSON"])
),
.define(
"YYJSON_DISABLE_UTF8_VALIDATION",
to: "1",
.when(traits: ["noUTF8Validation"])
),
]
),
.target(
name: "YYJSON",
dependencies: ["Cyyjson"],
swiftSettings: [
.enableUpcomingFeature("StrictConcurrency"),
.define("YYJSON_DISABLE_READER", .when(traits: ["noReader"])),
.define("YYJSON_DISABLE_WRITER", .when(traits: ["noWriter"])),
.define("YYJSON_DISABLE_INCR_READER", .when(traits: ["noIncrementalReader"])),
.define("YYJSON_DISABLE_UTILS", .when(traits: ["noUtilities"])),
.define("YYJSON_DISABLE_FAST_FP_CONV", .when(traits: ["noFastFloatingPoint"])),
.define("YYJSON_DISABLE_NON_STANDARD", .when(traits: ["strictStandardJSON"])),
.define("YYJSON_DISABLE_UTF8_VALIDATION", .when(traits: ["noUTF8Validation"])),
]
),
.testTarget(
name: "YYJSONTests",
dependencies: ["YYJSON"],
swiftSettings: [
.define("YYJSON_DISABLE_READER", .when(traits: ["noReader"])),
.define("YYJSON_DISABLE_WRITER", .when(traits: ["noWriter"])),
.define("YYJSON_DISABLE_INCR_READER", .when(traits: ["noIncrementalReader"])),
.define("YYJSON_DISABLE_UTILS", .when(traits: ["noUtilities"])),
.define("YYJSON_DISABLE_FAST_FP_CONV", .when(traits: ["noFastFloatingPoint"])),
.define("YYJSON_DISABLE_NON_STANDARD", .when(traits: ["strictStandardJSON"])),
.define("YYJSON_DISABLE_UTF8_VALIDATION", .when(traits: ["noUTF8Validation"])),
]
),
]
)