-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
Package.swift
250 lines (248 loc) · 12.2 KB
/
Package.swift
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
// swift-tools-version: 5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "WCDBSwift",
platforms: [
.macOS(.v10_13),
.watchOS(.v4),
.tvOS(.v12),
.iOS(.v12)],
products: [
.library(name: "WCDBSwift", targets: ["WCDBSwift"]),
.library(name: "WCDBSwiftDynamic", type: .dynamic, targets: ["WCDBSwift"]),
],
dependencies: [
.package(url: "https://github.com/Tencent/sqlcipher", .exactItem("1.4.6"))
],
targets: [
.target(
name: "objc-core",
path: "src/objc/core",
sources: ["WCTFileManager.mm", "WCTFoundation.mm", "WCTFTSTokenizerUtil.mm", "WCTOperationQueue.mm"],
publicHeadersPath:"",
cSettings: [
// .headerSearchPath("../../**"),
.headerSearchPath("../../bridge"),
.headerSearchPath("../../objc"),
.headerSearchPath("../../bridge/objcbridge"),
.headerSearchPath("../../bridge/cppbridge"),
.headerSearchPath("../../bridge/winqbridge"),
.headerSearchPath("../../bridge/base"),
.headerSearchPath("../../bridge/winqbridge/statement"),
.headerSearchPath("../../bridge/winqbridge/identifier"),
.headerSearchPath("../../common/core"),
.headerSearchPath("../../common/platform"),
.headerSearchPath("../../common/winq"),
.headerSearchPath("../../common/repair"),
.headerSearchPath("../../common/base"),
.headerSearchPath("../../common/utility"),
.headerSearchPath("../../common/core/config"),
.headerSearchPath("../../common/core/assemble"),
.headerSearchPath("../../common/core/vacuum"),
.headerSearchPath("../../common/core/cipher"),
.headerSearchPath("../../common/core/sqlite"),
.headerSearchPath("../../common/core/function"),
.headerSearchPath("../../common/core/fts"),
.headerSearchPath("../../common/core/operate"),
.headerSearchPath("../../common/core/compression"),
.headerSearchPath("../../common/core/integrity"),
.headerSearchPath("../../common/core/migration"),
.headerSearchPath("../../common/core/function/scalar"),
.headerSearchPath("../../common/core/fts/auxfunction"),
.headerSearchPath("../../common/core/fts/tokenizer"),
.headerSearchPath("../../common/winq/extension"),
.headerSearchPath("../../common/winq/statement"),
.headerSearchPath("../../common/winq/identifier"),
.headerSearchPath("../../common/winq/syntax"),
.headerSearchPath("../../common/winq/syntax/stmt"),
.headerSearchPath("../../common/winq/syntax/const"),
.headerSearchPath("../../common/winq/syntax/identifier"),
.headerSearchPath("../../common/repair/mechanic"),
.headerSearchPath("../../common/repair/parse"),
.headerSearchPath("../../common/repair/basic"),
.headerSearchPath("../../common/repair/sqlite"),
.headerSearchPath("../../common/repair/crawl"),
.headerSearchPath("../../common/repair/factory"),
.headerSearchPath("../../common/repair/utility"),
.headerSearchPath("../../objc/transaction"),
.headerSearchPath("../../objc/database"),
.headerSearchPath("../../objc/monitor"),
.headerSearchPath("../../objc/core"),
.headerSearchPath("../../objc/handle"),
.headerSearchPath("../../objc/bridge"),
.headerSearchPath("../../objc/statement"),
.headerSearchPath("../../objc/fts"),
.headerSearchPath("../../objc/chaincall"),
.headerSearchPath("../../objc/table"),
.headerSearchPath("../../objc/compression"),
.headerSearchPath("../../objc/orm"),
.headerSearchPath("../../objc/convenient"),
.headerSearchPath("../../objc/migration"),
.headerSearchPath("../../objc/builtin"),
.headerSearchPath("../../objc/orm/accessor"),
.headerSearchPath("../../objc/orm/binding"),
.headerSearchPath("../../objc/orm/macro"),
.headerSearchPath("../../objc/orm/coding")
],
linkerSettings: [
.linkedFramework("UIKit", .when(platforms: [.iOS])),
]
),
.target(
name: "common",
dependencies: ["sqlcipher", .target(name: "objc-core")],
path: "src/common",
exclude: [
"repair/sqlite",
"platform/WCTFileManager.cpp",
"platform/WCTOperationQueue.cpp",
],
publicHeadersPath:"",
cSettings: [
.define("SQLITE_WCDB", to: "1"),
.define("SQLITE_WCDB_LOCK_HOOK", to: "1"),
.define("SQLITE_WCDB_CHECKPOINT_HANDLER", to: "1"),
.define("SQLITE_WCDB_SUSPEND", to: "1"),
.define("SQLITE_WCDB_IMPROVED_CHECKPOINT", to: "1"),
.define("SQLITE_HAS_CODEC"),
.define("SQLITE_DEFAULT_PAGE_SIZE", to: "4096"),
.define("SQLITE_DEFAULT_SYNCHRONOUS", to: "1"),
.define("SQLITE_DEFAULT_WAL_SYNCHRONOUS", to: "1"),
.define("SQLITE_DEFAULT_LOCKING_MODE", to: "0"),
.define("SQLITE_DEFAULT_WAL_AUTOCHECKPOINT", to: "0"),
// .headerSearchPath("**")
.headerSearchPath("core"),
.headerSearchPath("platform"),
.headerSearchPath("winq"),
.headerSearchPath("repair"),
.headerSearchPath("base"),
.headerSearchPath("utility"),
.headerSearchPath("core/config"),
.headerSearchPath("core/assemble"),
.headerSearchPath("core/vacuum"),
.headerSearchPath("core/cipher"),
.headerSearchPath("core/sqlite"),
.headerSearchPath("core/function"),
.headerSearchPath("core/fts"),
.headerSearchPath("core/operate"),
.headerSearchPath("core/compression"),
.headerSearchPath("core/integrity"),
.headerSearchPath("core/migration"),
.headerSearchPath("core/function/scalar"),
.headerSearchPath("core/fts/auxfunction"),
.headerSearchPath("core/fts/tokenizer"),
.headerSearchPath("winq/extension"),
.headerSearchPath("winq/statement"),
.headerSearchPath("winq/identifier"),
.headerSearchPath("winq/syntax"),
.headerSearchPath("winq/syntax/stmt"),
.headerSearchPath("winq/syntax/const"),
.headerSearchPath("winq/syntax/identifier"),
.headerSearchPath("repair/mechanic"),
.headerSearchPath("repair/parse"),
.headerSearchPath("repair/basic"),
.headerSearchPath("repair/sqlite"),
.headerSearchPath("repair/crawl"),
.headerSearchPath("repair/factory"),
.headerSearchPath("repair/utility")
],
linkerSettings: [
.linkedLibrary("z"),
]
),
.target(
name: "bridge",
dependencies: [.target(name: "common")],
path: "src/bridge",
exclude: [
"tests",
],
cSettings: [
// .headerSearchPath("../**")
.headerSearchPath("../bridge"),
.headerSearchPath("../objc"),
.headerSearchPath("../bridge/objcbridge"),
.headerSearchPath("../bridge/cppbridge"),
.headerSearchPath("../bridge/winqbridge"),
.headerSearchPath("../bridge/base"),
.headerSearchPath("../bridge/winqbridge/statement"),
.headerSearchPath("../bridge/winqbridge/identifier"),
.headerSearchPath("../common/core"),
.headerSearchPath("../common/platform"),
.headerSearchPath("../common/winq"),
.headerSearchPath("../common/repair"),
.headerSearchPath("../common/base"),
.headerSearchPath("../common/utility"),
.headerSearchPath("../common/core/config"),
.headerSearchPath("../common/core/assemble"),
.headerSearchPath("../common/core/vacuum"),
.headerSearchPath("../common/core/cipher"),
.headerSearchPath("../common/core/sqlite"),
.headerSearchPath("../common/core/function"),
.headerSearchPath("../common/core/fts"),
.headerSearchPath("../common/core/operate"),
.headerSearchPath("../common/core/compression"),
.headerSearchPath("../common/core/integrity"),
.headerSearchPath("../common/core/migration"),
.headerSearchPath("../common/core/function/scalar"),
.headerSearchPath("../common/core/fts/auxfunction"),
.headerSearchPath("../common/core/fts/tokenizer"),
.headerSearchPath("../common/winq/extension"),
.headerSearchPath("../common/winq/statement"),
.headerSearchPath("../common/winq/identifier"),
.headerSearchPath("../common/winq/syntax"),
.headerSearchPath("../common/winq/syntax/stmt"),
.headerSearchPath("../common/winq/syntax/const"),
.headerSearchPath("../common/winq/syntax/identifier"),
.headerSearchPath("../common/repair/mechanic"),
.headerSearchPath("../common/repair/parse"),
.headerSearchPath("../common/repair/basic"),
.headerSearchPath("../common/repair/sqlite"),
.headerSearchPath("../common/repair/crawl"),
.headerSearchPath("../common/repair/factory"),
.headerSearchPath("../common/repair/utility"),
.headerSearchPath("../objc/transaction"),
.headerSearchPath("../objc/database"),
.headerSearchPath("../objc/monitor"),
.headerSearchPath("../objc/core"),
.headerSearchPath("../objc/handle"),
.headerSearchPath("../objc/bridge"),
.headerSearchPath("../objc/statement"),
.headerSearchPath("../objc/fts"),
.headerSearchPath("../objc/chaincall"),
.headerSearchPath("../objc/table"),
.headerSearchPath("../objc/compression"),
.headerSearchPath("../objc/orm"),
.headerSearchPath("../objc/convenient"),
.headerSearchPath("../objc/migration"),
.headerSearchPath("../objc/builtin"),
.headerSearchPath("../objc/orm/accessor"),
.headerSearchPath("../objc/orm/binding"),
.headerSearchPath("../objc/orm/macro"),
.headerSearchPath("../objc/orm/coding")
]
),
.target(
name: "WCDBSwift",
dependencies: [.target(name: "bridge")],
path: "src/swift",
exclude: [
"tests"
],
publicHeadersPath: ".",
cSettings: [
// .headerSearchPath("../bridge/**")
.headerSearchPath("../bridge"),
.headerSearchPath("../bridge/objcbridge"),
.headerSearchPath("../bridge/cppbridge"),
.headerSearchPath("../bridge/winqbridge"),
.headerSearchPath("../bridge/base"),
.headerSearchPath("../bridge/winqbridge/statement"),
.headerSearchPath("../bridge/winqbridge/identifier")
]
)
],
cLanguageStandard: .c11,
cxxLanguageStandard: .cxx14
)