forked from sbooth/CSQLite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPackage.swift
More file actions
131 lines (124 loc) · 4.5 KB
/
Package.swift
File metadata and controls
131 lines (124 loc) · 4.5 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
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
// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.
/*
** 2022-02-25
**
** The author disclaims copyright to this source code. In place of
** a legal notice, here is a blessing:
**
** May you do good and not evil.
** May you find forgiveness for yourself and forgive others.
** May you share freely, never taking more than you give.
**
******************************************************************************
**
** Swift Package Manager manifest for the CSQLite package.
*/
import PackageDescription
/// Compile-time options
/// - seealso: [Recommended Compile-time Options](https://sqlite.org/compile.html#recommended_compile_time_options)
let compileTimeOptions: [CSetting] = [
// https://sqlite.org/compile.html#dqs
.define("SQLITE_DQS", to: "0"),
// https://sqlite.org/compile.html#threadsafe
.define("SQLITE_THREADSAFE", to: "2"),
// https://sqlite.org/compile.html#default_memstatus
.define("SQLITE_DEFAULT_MEMSTATUS", to: "0"),
// https://sqlite.org/compile.html#default_wal_synchronous
.define("SQLITE_DEFAULT_WAL_SYNCHRONOUS", to: "1"),
// https://sqlite.org/compile.html#like_doesnt_match_blobs
.define("SQLITE_LIKE_DOESNT_MATCH_BLOBS"),
// https://sqlite.org/limits.html#max_expr_depth
.define("SQLITE_MAX_EXPR_DEPTH", to: "0"),
// https://sqlite.org/compile.html#omit_decltype
// .define("SQLITE_OMIT_DECLTYPE"),
// https://sqlite.org/compile.html#omit_deprecated
// .define("SQLITE_OMIT_DEPRECATED"),
// https://sqlite.org/compile.html#omit_progress_callback
.define("SQLITE_OMIT_PROGRESS_CALLBACK"),
// https://sqlite.org/compile.html#omit_shared_cache
.define("SQLITE_OMIT_SHARED_CACHE"),
// https://sqlite.org/compile.html#use_alloca
.define("SQLITE_USE_ALLOCA"),
// https://sqlite.org/compile.html#omit_autoinit
// .define("SQLITE_OMIT_AUTOINIT"),
// https://sqlite.org/compile.html#strict_subtype
.define("SQLITE_STRICT_SUBTYPE", to: "1"),
]
/// Platform configuration
/// - seealso: [Platform Configuration](https://sqlite.org/compile.html#_platform_configuration)
let platformConfiguration: [CSetting] = [
.define("HAVE_ISNAN", to: "1"),
.define("HAVE_UTIME", to: "1"),
]
/// Features
/// - seealso: [Options To Enable Features Normally Turned Off](https://sqlite.org/compile.html#_options_to_enable_features_normally_turned_off)
let features: [CSetting] = [
// https://sqlite.org/c3ref/column_database_name.html
.define("SQLITE_ENABLE_COLUMN_METADATA"),
// https://sqlite.org/fts4.html
.define("SQLITE_ENABLE_FTS4"),
// https://sqlite.org/fts5.html
.define("SQLITE_ENABLE_FTS5"),
// https://sqlite.org/geopoly.html
// .define("SQLITE_ENABLE_GEOPOLY"),
// .define("SQLITE_ENABLE_ICU"),
// https://sqlite.org/lang_mathfunc.html
.define("SQLITE_ENABLE_MATH_FUNCTIONS"),
// --> For pre-update hook support uncomment the following define
// https://sqlite.org/c3ref/preupdate_blobwrite.html
.define("SQLITE_ENABLE_PREUPDATE_HOOK"),
// https://sqlite.org/rtree.html
.define("SQLITE_ENABLE_RTREE"),
// --> For session support uncomment the following define and enable the pre-update hook
// https://sqlite.org/sessionintro.html
.define("SQLITE_ENABLE_SESSION"),
// https://sqlite.org/c3ref/snapshot.html
.define("SQLITE_ENABLE_SNAPSHOT"),
// https://sqlite.org/stmt.html
.define("SQLITE_ENABLE_STMTVTAB"),
// https://sqlite.org/fileformat2.html#stat4tab
.define("SQLITE_ENABLE_STAT4"),
.define("SQLITE_ENABLE_API_ARMOR"),
.define("SQLITE_ENABLE_DBSTAT_VTAB"),
.define("SQLITE_ENABLE_MEMORY_MANAGEMENT"),
.define("SQLITE_ENABLE_PREUPDATE_HOOK"),
.define("SQLITE_ENABLE_RTREE"),
.define("SQLITE_ENABLE_STMTVTAB"),
.define("SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION"),
.define("SQLITE_ENABLE_UNLOCK_NOTIFY"),
.define("SQLITE_MAX_VARIABLE_NUMBER", to: "250000"),
.define("SQLITE_USE_URI"),
.define("SQLITE_HAS_CODEC"),
.define("SQLITE_TEMP_STORE", to: "2"),
.define("HAVE_GETHOSTUUID", to: "0"),
]
let package = Package(
name: "CSQLite",
products: [
.library(
name: "CSQLite",
targets: [
"CSQLite",
]),
],
targets: [
.target(
name: "CSQLite",
cSettings: compileTimeOptions + platformConfiguration + features + [
// For statically linking extensions
// https://sqlite.org/loadext.html#statically_linking_a_run_time_loadable_extension
.define("SQLITE_CORE", to: "1"),
],
linkerSettings: [
.linkedLibrary("m"),
.linkedLibrary("log", .when(platforms: [.android])),
]),
.testTarget(
name: "CSQLiteTests",
dependencies: [
"CSQLite",
])
],
cLanguageStandard: .gnu11
)