mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-24 04:07:47 +00:00
2.0 KiB
2.0 KiB
##GRDBCustomSQLite Build GRDB with a custom version/configuration of SQLite embedded.
Note
: By default, SQLiteLib is built with options essentially matching the built-in system library on OSX/iOS.
###To add an SQLite Compilation option:
- Add it to the "SQLiteLib-Custom.xcconfig" in the SQLiteLib.xcodeproj to expose it to the SQLite build process (see SQLiteLib reference)
- Add it to the
CUSTOM_OTHER_SWIFT_FLAGSline in "GRDBCustomSQLite-Custom.xcconfig", to expose it to GRDB's code. - Add it as a
#definein "GRDBCustomSQLite.h", to expose it in the public headers for the built GRDBCustomSQLite framework.
####Example:
To build GRDBCustomSQLite with the JSON SQL functions enabled (SQLITE_ENABLE_JSON1).
- Open "SQLiteLib-Custom.xcconfig" under GRDBCustomSQLite > SQLiteLib.xcodeproj in Xcode.
- Append
-DSQLITE_ENABLE_JSON1to the lineCUSTOM_SQLLIBRARY_CFLAGS.
Before:
CUSTOM_SQLLIBRARY_CFLAGS = -DSQLITE_ENABLE_PREUPDATE_HOOK
After:
CUSTOM_SQLLIBRARY_CFLAGS = -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_JSON1
- Open "GRDBCustomSQLite-Custom.xcconfig" under the GRDBCustomSQLite group in Xcode.
- Append
-D SQLITE_ENABLE_JSON1to the lineCUSTOM_OTHER_SWIFT_FLAGS.
Before:
CUSTOM_OTHER_SWIFT_FLAGS = -D SQLITE_ENABLE_PREUPDATE_HOOK
After:
CUSTOM_OTHER_SWIFT_FLAGS = -D SQLITE_ENABLE_PREUPDATE_HOOK -D SQLITE_ENABLE_JSON1
- Open "GRDBCustomSQLite.h" under the GRDBCustomSQLite group in Xcode.
- Append a line containing
#define SQLITE_ENABLE_JSON1after// INSERT ANY ADDITIONAL SQLITE DEFINES HERE