Commit d74ec06
committed
CMake tweaks for non-sqlcipher key support
The `SQLITE_HAS_CODEC` option currently does two separate things: it
enables usage of the key API, and it forces searching for sqlcipher
headers when finding SQLite.
When attempting to use an alternative to sqlcipher (such as sqlite-ee or
sqlite-multiple-ciphers) the former is wanted, and the latter is
absolutely not wanted.
The previous commit allows working around the sqlcipher search by simply
bypassing the find process entirely and allowing a parent project to set
up SQLite3::SQLite however it wants. That, combined with
SQLITE_HAS_CODEC=ON, allows using SQLiteCpp with encryption API with
some alternative to sqlcipher.
This commit adds some small "niceness" updates:
- make the SQLITE_HAS_CODEC compile definition PRIVATE as it only
affects internal code in Database.cpp and does not require propagation
to linking code. (Building sqlcipher itself requires this definition,
but SQLiteCpp does not support building sqlcipher, it only finds an
already-built one).
- sqlite3_key_v2 is not actually required or used (and appears to be
sqlcipher-specific), but sqlite3_rekey is. (`sqlite3_key` and
`sqlite3_rekey` are supported by all of sqlcipher, sqlite-mc, and
sqlite-ee).
- SQLITE_HAS_CODEC combined with SQLITECPP_INTERNAL_SQLITE will not
compile as the internal version is stock sqlite3, and this adds a
check and fatal error if attempting that configuration.1 parent 8b816df commit d74ec06
2 files changed
+13
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
231 | | - | |
| 231 | + | |
232 | 232 | | |
233 | | - | |
234 | | - | |
235 | | - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
236 | 237 | | |
237 | 238 | | |
238 | 239 | | |
| |||
279 | 280 | | |
280 | 281 | | |
281 | 282 | | |
282 | | - | |
| 283 | + | |
283 | 284 | | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
284 | 289 | | |
285 | 290 | | |
286 | 291 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
0 commit comments