From 8213bf5b6d3b0bfd357a9fbb1639f5992b0ce7ed Mon Sep 17 00:00:00 2001 From: swiftlyfalling Date: Tue, 31 May 2016 17:32:09 -0400 Subject: [PATCH] Update to point to SQLiteLib-USER.xcconfig, and new SQLiteLib --- SQLiteCustom/GRDB.xcconfig | 2 +- .../GRDBCustomSQLite-Testing.xcconfig | 4 +- .../GRDBCustomSQLite-USER.xcconfig.example | 4 +- SQLiteCustom/README.md | 42 ++++++++++++++----- SQLiteCustom/src | 2 +- 5 files changed, 39 insertions(+), 15 deletions(-) diff --git a/SQLiteCustom/GRDB.xcconfig b/SQLiteCustom/GRDB.xcconfig index c956b7d3e..80950bd2d 100755 --- a/SQLiteCustom/GRDB.xcconfig +++ b/SQLiteCustom/GRDB.xcconfig @@ -2,7 +2,7 @@ CUSTOM_OTHER_SWIFT_FLAGS= // do not modify // Build once to generate this file: #include "GRDBCustomSQLite-USER.xcconfig" -#include "../SQLiteCustom/src/SQLiteLib-Custom.xcconfig" +#include "src/SQLiteLib-USER.xcconfig" INFOPLIST_FILE = Support/Info.plist PRODUCT_NAME = GRDBCustomSQLite diff --git a/SQLiteCustom/GRDBCustomSQLite-Testing.xcconfig b/SQLiteCustom/GRDBCustomSQLite-Testing.xcconfig index 6dd18bd85..6f2d42a90 100755 --- a/SQLiteCustom/GRDBCustomSQLite-Testing.xcconfig +++ b/SQLiteCustom/GRDBCustomSQLite-Testing.xcconfig @@ -1,9 +1,11 @@ // DO NOT MODIFY. // This config file is used to expose other settings to the test bundle. +CUSTOM_OTHER_SWIFT_FLAGS= // do not modify + // Build once to generate this file: #include "GRDBCustomSQLite-USER.xcconfig" -#include "../SQLiteCustom/src/SQLiteLib-Custom.xcconfig" +#include "src/SQLiteLib-USER.xcconfig" OTHER_CFLAGS = -DUSING_BUILTIN_SQLITE -DUSING_CUSTOMSQLITE $(CUSTOM_SQLLIBRARY_CFLAGS) // Do not modify. OTHER_SWIFT_FLAGS = -D USING_BUILTIN_SQLITE -D USING_CUSTOMSQLITE $(CUSTOM_OTHER_SWIFT_FLAGS) // Do not modify. diff --git a/SQLiteCustom/GRDBCustomSQLite-USER.xcconfig.example b/SQLiteCustom/GRDBCustomSQLite-USER.xcconfig.example index 8997421f8..bb076559a 100755 --- a/SQLiteCustom/GRDBCustomSQLite-USER.xcconfig.example +++ b/SQLiteCustom/GRDBCustomSQLite-USER.xcconfig.example @@ -1,9 +1,11 @@ // To compile SQLite with additional compilation options: -// 1.) Add them to the "SQLiteLib-Custom.xcconfig" in the SQLiteLib.xcodeproj +// 1.) Add them to the "SQLiteLib-USER.xcconfig" in the SQLiteLib.xcodeproj // 2.) Add them to the CUSTOM_OTHER_SWIFT_FLAGS line below. // 3.) Optionally add them to "GRDBCustomSQLite-USER.h" to expose the appropriate SQLite APIs to framework consumers. // +// See the README.md file for more details. +// // How to Convert OTHER_CFLAGS to OTHER_SWIFT_FLAGS: // Add a space after the "-D" // diff --git a/SQLiteCustom/README.md b/SQLiteCustom/README.md index 1c63eb63f..9e29fc6bf 100644 --- a/SQLiteCustom/README.md +++ b/SQLiteCustom/README.md @@ -3,40 +3,60 @@ 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](https://github.com/swiftlyfalling/SQLiteLib/blob/master/README.md#default-compilation-options). +**TIP:** Build GRDBCustomSQLite once to generate the USER config files from the `.example` files. +Future builds should remove any warnings about missing files. (These warnings don't affect functionality.) + +###Configuration / Before First Build: + +To build without warnings, you need to generate the USER configuration files. + +**Option A:** + +Simply run build once, and the project will automatically generate them. + +**Option B:** + +If you'd prefer to do it manually, copy the appropriate .example files and rename them to the required files below: + +- `GRDBCustomSQLite-USER.h` +- `GRDBCustomSQLite-USER.xcconfig` +- `src/SQLiteLib-USER.xcconfig` (required by the SQLiteLib project) + + ###To add an SQLite Compilation option: -1. Add it to the "*SQLiteLib-Custom.xcconfig*" in the **SQLiteLib.xcodeproj** to expose it to the SQLite build process ([see SQLiteLib reference](https://github.com/swiftlyfalling/SQLiteLib/blob/master/README.md)) -2. Add it to the `CUSTOM_OTHER_SWIFT_FLAGS` line in "*GRDBCustomSQLite-Custom.xcconfig*", to expose it to GRDB's code. -3. Add it as a `#define` in "*GRDBCustomSQLite.h*", to expose it in the public headers for the built GRDBCustomSQLite framework. +1. Add it to the "*SQLiteLib-USER.xcconfig*" in the **SQLiteLib.xcodeproj** to expose it to the SQLite build process ([see SQLiteLib reference](https://github.com/swiftlyfalling/SQLiteLib/blob/master/README.md)) +2. Add it to the `CUSTOM_OTHER_SWIFT_FLAGS` line in "*GRDBCustomSQLite-USER.xcconfig*", to expose it to GRDB's code. +3. Add it as a `#define` in "*GRDBCustomSQLite-USER.h*", to expose it in the public headers for the built GRDBCustomSQLite framework. ####Example: To build GRDBCustomSQLite with the [JSON SQL functions](https://www.sqlite.org/json1.html) enabled (`SQLITE_ENABLE_JSON1`). -1. Open "**[SQLiteLib-Custom.xcconfig](src/SQLiteLib-Custom.xcconfig)**" under **GRDBCustomSQLite > SQLiteLib.xcodeproj** in Xcode. +1. Open "**[SQLiteLib-USER.xcconfig](src/SQLiteLib-USER.xcconfig.example)**" under **GRDBCustomSQLite > SQLiteLib.xcodeproj** in Xcode. 2. Append `-DSQLITE_ENABLE_JSON1` to the line `CUSTOM_SQLLIBRARY_CFLAGS`. > Before: -> `CUSTOM_SQLLIBRARY_CFLAGS = -DSQLITE_ENABLE_PREUPDATE_HOOK` +> `CUSTOM_SQLLIBRARY_CFLAGS = ` > After: -> `CUSTOM_SQLLIBRARY_CFLAGS = -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_JSON1` +> `CUSTOM_SQLLIBRARY_CFLAGS = -DSQLITE_ENABLE_JSON1` -3. Open "**[GRDBCustomSQLite-Custom.xcconfig](GRDBCustomSQLite-Custom.xcconfig)**" under the **GRDBCustomSQLite** group in Xcode. +3. Open "**[GRDBCustomSQLite-USER.xcconfig](GRDBCustomSQLite-USER.xcconfig.example)**" under the **GRDBCustomSQLite > Customize** group in Xcode. 4. Append `-D SQLITE_ENABLE_JSON1` to the line `CUSTOM_OTHER_SWIFT_FLAGS`. > Before: -> `CUSTOM_OTHER_SWIFT_FLAGS = -D SQLITE_ENABLE_PREUPDATE_HOOK` +> `CUSTOM_OTHER_SWIFT_FLAGS = ` > After: -> `CUSTOM_OTHER_SWIFT_FLAGS = -D SQLITE_ENABLE_PREUPDATE_HOOK -D SQLITE_ENABLE_JSON1` +> `CUSTOM_OTHER_SWIFT_FLAGS = -D SQLITE_ENABLE_JSON1` -5. Open "**[GRDBCustomSQLite.h](GRDBCustomSQLite.h)**" under the **GRDBCustomSQLite** group in Xcode. -6. Append a line containing `#define SQLITE_ENABLE_JSON1` after `// INSERT ANY ADDITIONAL SQLITE DEFINES HERE` +5. Open "**[GRDBCustomSQLite-USER.h](GRDBCustomSQLite-USER.h.example)**" under the **GRDBCustomSQLite > Customize** group in Xcode. +6. Append a line containing `#define SQLITE_ENABLE_JSON1` after `// INSERT ANY ADDITIONAL SQLITE DEFINES HERE:` ### To use a custom version of SQLite: diff --git a/SQLiteCustom/src b/SQLiteCustom/src index b7a04197d..891853fe5 160000 --- a/SQLiteCustom/src +++ b/SQLiteCustom/src @@ -1 +1 @@ -Subproject commit b7a04197d3236b89da9f72618e20f4d14aeab721 +Subproject commit 891853fe56a3bcbdaf9a42dfd64f4ff4a8613ca2