-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathPackage.swift
More file actions
100 lines (98 loc) · 4.67 KB
/
Package.swift
File metadata and controls
100 lines (98 loc) · 4.67 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
100
// swift-tools-version: 5.9
import PackageDescription
let package = Package(
name: "skip-sql",
defaultLocalization: "en",
platforms: [.iOS(.v16), .macOS(.v13), .tvOS(.v16), .watchOS(.v9), .macCatalyst(.v16)],
products: [
.library(name: "SkipSQL", targets: ["SkipSQL"]),
.library(name: "SkipSQLPlus", type: .dynamic, targets: ["SkipSQLPlus"]),
],
dependencies: [
.package(url: "https://source.skip.tools/skip.git", from: "1.1.11"),
.package(url: "https://source.skip.tools/skip-foundation.git", from: "1.1.11"),
.package(url: "https://source.skip.tools/skip-unit.git", from: "1.0.1"),
.package(url: "https://source.skip.tools/skip-ffi.git", from: "1.0.0"),
],
targets: [
.target(name: "SkipSQLCore", dependencies: [
.product(name: "SkipFoundation", package: "skip-foundation"),
.product(name: "SkipFFI", package: "skip-ffi")
], plugins: [.plugin(name: "skipstone", package: "skip")]),
.target(name: "SkipSQL", dependencies: [
"SkipSQLCore",
], plugins: [.plugin(name: "skipstone", package: "skip")]),
.testTarget(name: "SkipSQLTests", dependencies: [
"SkipSQL",
.product(name: "SkipTest", package: "skip")
], plugins: [.plugin(name: "skipstone", package: "skip")]),
.target(name: "SkipSQLPlus", dependencies: [
"SkipSQLCore",
"SQLExt",
], plugins: [.plugin(name: "skipstone", package: "skip")]),
.testTarget(name: "SkipSQLPlusTests", dependencies: [
"SkipSQLPlus",
.product(name: "SkipTest", package: "skip")
], plugins: [.plugin(name: "skipstone", package: "skip")]),
.target(name: "SQLExt", dependencies: [
.product(name: "SkipUnit", package: "skip-unit")
],
sources: ["sqlite", "libtomcrypt"],
publicHeadersPath: "sqlite",
cSettings: [
.headerSearchPath("libtomcrypt/headers"),
.define("NDEBUG"),
.define("SQLITE_DQS", to: "0"),
.define("SQLITE_ENABLE_API_ARMOR"),
.define("SQLITE_ENABLE_COLUMN_METADATA"),
.define("SQLITE_ENABLE_DBSTAT_VTAB"),
.define("SQLITE_ENABLE_FTS3"),
.define("SQLITE_ENABLE_FTS3_PARENTHESIS"),
.define("SQLITE_ENABLE_FTS3_TOKENIZER"),
.define("SQLITE_ENABLE_FTS4"),
.define("SQLITE_ENABLE_FTS5"),
.define("SQLITE_ENABLE_MEMORY_MANAGEMENT"),
.define("SQLITE_ENABLE_PREUPDATE_HOOK"),
.define("SQLITE_ENABLE_RTREE"),
.define("SQLITE_ENABLE_SESSION"),
.define("SQLITE_ENABLE_STMTVTAB"),
.define("SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION"),
.define("SQLITE_ENABLE_UNLOCK_NOTIFY"),
.define("SQLITE_MAX_VARIABLE_NUMBER", to: "250000"),
.define("SQLITE_LIKE_DOESNT_MATCH_BLOBS"),
.define("SQLITE_OMIT_DEPRECATED"),
.define("SQLITE_OMIT_SHARED_CACHE"),
.define("SQLITE_SECURE_DELETE"),
.define("SQLITE_THREADSAFE", to: "2"),
.define("SQLITE_USE_URI"),
.define("SQLITE_ENABLE_SNAPSHOT"),
.define("SQLITE_HAS_CODEC"),
.define("SQLITE_HOMEGROWN_RECURSIVE_MUTEX"), // needed or we see hangs in test cases
.define("SQLITE_TEMP_STORE", to: "2"),
.define("SQLITE_EXTRA_INIT", to: "sqlcipher_extra_init"),
.define("SQLITE_EXTRA_SHUTDOWN", to: "sqlcipher_extra_shutdown"),
.define("HAVE_GETHOSTUUID", to: "0"),
.define("HAVE_STDINT_H"),
.define("SQLCIPHER_CRYPTO_LIBTOMCRYPT"),
.define("SQLCIPHER_CRYPTO_CUSTOM", to: "sqlcipher_ltc_setup"),
//.unsafeFlags(["-Wno-shorten-64-to-32", "-Wno-ambiguous-macro"]), // enabled manually in libs
],
linkerSettings: [.linkedLibrary("log", .when(platforms: [.android]))],
plugins: [.plugin(name: "skipstone", package: "skip")]),
]
)
// TODO: this might be the route to take to add Linux support to SkipSQL itself
#if false
#if os(Linux) || os(Windows)
package.dependencies += [.package(url: "https://github.com/swiftlang/swift-toolchain-sqlite.git", from: "1.0.0")]
package.targets += [
.target(
name: "SQLite3",
dependencies: [
.product(name: "SwiftToolchainCSQLite", package: "swift-toolchain-sqlite", condition: .when(platforms: [.linux, .windows, .android]))
]
)
]
package.targets[0].dependencies += [.target(name: "SQLite3")]
#endif
#endif