You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+46-53Lines changed: 46 additions & 53 deletions
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,12 @@
1
1
SQLiteLib
2
2
==========
3
3
4
+
4
5
Easily build a custom SQLite static library for use in OSX and iOS frameworks and apps.
5
6
6
7
If you need a specific version of SQLite, or specific SQLite compilation options/features, read on.
7
8
8
-
==========
9
+
9
10
10
11
**May 29, 2016: SQLiteLib updated for SQLite 3.13.0** ([changelog](CHANGELOG.md)).
11
12
@@ -15,13 +16,11 @@ If you need a specific version of SQLite, or specific SQLite compilation options
15
16
16
17
17
18
18
-
---
19
-
20
-
### Installation:
21
-
22
19
==========
23
20
24
-
#### Manual Installation (ex. into a Framework)
21
+
## Installation:
22
+
23
+
#### Manual Installation (ex. into a Framework):
25
24
26
25
1. Download a copy of SQLiteLib.
27
26
2. Embed the `SQLiteLib.xcodeproj` project in your own project.
@@ -30,23 +29,20 @@ If you need a specific version of SQLite, or specific SQLite compilation options
30
29
31
30
That's it! (You'll probably also want to `#include "sqlite3.h"` somewhere. SQLiteLib copies this generated file to its project directory.)
32
31
33
-
==========
34
32
35
-
#### Using in Swift
33
+
#### Using in Swift:
36
34
37
35
You probably shouldn't be using the raw SQLite C API in Swift. There are a bunch of great libraries available that wrap it.
38
36
39
37
For example: ([GRDB.swift](https://github.com/groue/GRDB.swift)).
40
38
41
-
---
42
39
43
-
###Customization:
40
+
## Customization:
44
41
45
42
By default, SQLiteLib builds SQLite with options that match the built-in system version of SQLite on OSX and iOS (as of OSX 10.11.5, iOS 9.3.2), [with one exception*](#additional-details).
> By default, SQLiteLib compiles SQLite with options that match the built-in OSX/iOS version of SQLite (as of OSX 10.11, iOS 9.3.2), with one exception*.
52
48
> You only need to follow the steps below if you wish to customize the options.
SQLiteLib currently ships with the source for SQLite 3.13.0.
72
67
@@ -83,52 +78,50 @@ If you'd like to compile a newer (or older) version, the process is simple:
83
78
> Setting compilation options using the SQLite amalgamation is not guaranteed to work:
84
79
> > The versions of the SQLite amalgamation that are supplied on the download page are normally adequate for most users. However, some projects may want or need to build their own amalgamations. A common reason for building a custom amalgamation is in order to use certain compile-time options to customize the SQLite library. Recall that the SQLite amalgamation contains a lot of C-code that is generated by auxiliary programs and scripts. Many of the compile-time options effect this generated code and **must be supplied to the code generators before the amalgamation is assembled**.
85
80
86
-
==========
87
81
88
-
**Quick Guide to Using the Latest version of SQLite**:
82
+
####**Quick Guide to Using the Latest version of SQLite**:
89
83
90
84
The snapshop of the complete (raw) source tree for the *current* version of SQLite is available on the ([SQLite Download Page](https://www.sqlite.org/download.html#old)) under: **Alternative Source Code Formats**.
91
85
You'll want the file named "sqlite-src-*version*.zip".
92
86
> Do **NOT** use the file beginning with "sqlite-preprocessed" - it will not work properly.
93
87
94
-
---
95
88
96
-
### Additional Details:
97
89
98
-
==========
90
+
## Additional Details:
91
+
99
92
100
-
#### Default Compilation Options
93
+
#### Default Compilation Options:
101
94
102
95
The built-in OSX/iOS version of SQLite were built with the following compilation options (as of OSX 10.11.5, iOS 9.3.2):
103
96
104
97
> Fetched using `PRAGMA compile_options;`
105
98
106
99
- MacOSX (10.11.5)
107
-
- ENABLE_API_ARMOR
108
-
- ENABLE_FTS3
109
-
- ENABLE_FTS3_PARENTHESIS
110
-
- ENABLE_LOCKING_STYLE=1
111
-
- ENABLE_RTREE
112
-
- ENABLE_UPDATE_DELETE_LIMIT
113
-
- OMIT_AUTORESET
114
-
- OMIT_BUILTIN_TEST
115
-
- OMIT_LOAD_EXTENSION
116
-
- SYSTEM_MALLOC
117
-
- THREADSAFE=2
100
+
-`ENABLE_API_ARMOR`
101
+
-`ENABLE_FTS3`
102
+
-`ENABLE_FTS3_PARENTHESIS`
103
+
-`ENABLE_LOCKING_STYLE=1`
104
+
-`ENABLE_RTREE`
105
+
-`ENABLE_UPDATE_DELETE_LIMIT`
106
+
-`OMIT_AUTORESET`
107
+
-`OMIT_BUILTIN_TEST`
108
+
-`OMIT_LOAD_EXTENSION`
109
+
-`SYSTEM_MALLOC`
110
+
-`THREADSAFE=2`
118
111
119
112
- iPhoneOS (9.3.2)
120
-
- ENABLE_API_ARMOR
121
-
- ENABLE_FTS3
122
-
- ENABLE_FTS3_PARENTHESIS
123
-
- ENABLE_LOCKING_STYLE=1
124
-
- ENABLE_RTREE
125
-
- ENABLE_UPDATE_DELETE_LIMIT
126
-
- MAX_MMAP_SIZE=0
127
-
- OMIT_AUTORESET
128
-
- OMIT_BUILTIN_TEST
129
-
- OMIT_LOAD_EXTENSION
130
-
- SYSTEM_MALLOC
131
-
- THREADSAFE=2
113
+
-`ENABLE_API_ARMOR`
114
+
-`ENABLE_FTS3`
115
+
-`ENABLE_FTS3_PARENTHESIS`
116
+
-`ENABLE_LOCKING_STYLE=1`
117
+
-`ENABLE_RTREE`
118
+
-`ENABLE_UPDATE_DELETE_LIMIT`
119
+
-`MAX_MMAP_SIZE=0`
120
+
-`OMIT_AUTORESET`
121
+
-`OMIT_BUILTIN_TEST`
122
+
-`OMIT_LOAD_EXTENSION`
123
+
-`SYSTEM_MALLOC`
124
+
-`THREADSAFE=2`
132
125
133
126
SQLiteLib uses these settings with one exception - on iOS:
134
127
@@ -142,33 +135,33 @@ D. Richard Hipp (SQLite architect), suggests working around this on iOS using `-
142
135
>
143
136
> I'm guessing this is not really a factor on iOS."
144
137
145
-
Thus, SQLiteLib uses SQLITE_ENABLE_LOCKING_STYLE=1 on OSX,
146
-
**but on iOS, SQLiteLib compiles with ENABLE_LOCKING_STYLE=0**.
138
+
Thus, SQLiteLib uses `SQLITE_ENABLE_LOCKING_STYLE=1` on OSX,
139
+
**but on iOS, SQLiteLib compiles with `ENABLE_LOCKING_STYLE=0`**.
147
140
148
141
This removes the code that uses the deprecated function, but doesn't get rid of the warning that "`gethostuuid() is disabled`" (as of 3.13.0).
149
142
150
143
To prevent this warning, SQLiteLib separately specifies `-Wno-#warnings` when building for iOS.
151
144
152
145
All of these base settings are configured in the SQLiteLib.xcconfig file.
153
-
It is strongly recommended that you do not edit this file. If you'd like to specify additional compilation options, see [the instructions above](#specifying-additional-sqlite-compilation-options)
146
+
It is strongly recommended that you do not edit this file. If you'd like to specify additional compilation options, see [the instructions above](#specifying-additional-sqlite-compilation-options).
147
+
154
148
155
-
==========
156
149
157
-
#### Build Locations
150
+
#### Build Locations:
158
151
159
152
SQLiteLib generates intermediate files in [${DERIVED_SOURCES_DIR}](https://developer.apple.com/library/mac/documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html#//apple_ref/doc/uid/TP40003931-CH3-SW43).
160
153
161
154
The generated SQLite amalgamation files are copied to:
162
155
163
-
-"${BUILT_PRODUCTS_DIR}/sqlite3.c"
156
+
-`${BUILT_PRODUCTS_DIR}/sqlite3.c`
157
+
158
+
-`${PROJECT_DIR}/sqlite3.h`
164
159
165
-
-"${PROJECT_DIR}/sqlite3.h"
166
160
167
-
---
168
161
169
-
####Notes:
162
+
## Notes:
170
163
171
-
##### "sqlite3.c" shows as red/missing in Xcode
164
+
##### "sqlite3.c" shows as red/missing in Xcode:
172
165
173
166
Xcode (verified in Version 7.3.1 (7D1014)) will always show "sqlite3.c" as red/missing, even after a build.
0 commit comments