Skip to content

Commit 0725a2e

Browse files
Add Xcode project
1 parent 31227da commit 0725a2e

File tree

6 files changed

+598
-0
lines changed

6 files changed

+598
-0
lines changed

SQLiteLib-Custom.xcconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
// Custom additions to the SQLite compilation options
3+
// These are merged with the default options (for OSX / iOS)
4+
//
5+
// As an example, SQLITE_ENABLE_PREUPDATE_HOOK is set below.
6+
// (On SQLite 3.13.0+, this enables pre-update hook functionality.)
7+
//
8+
// For more information on the options, see: https://www.sqlite.org/compile.html
9+
10+
// Added to OTHER_CFLAGS in all cases
11+
CUSTOM_SQLLIBRARY_CFLAGS = -DSQLITE_ENABLE_PREUPDATE_HOOK

SQLiteLib.xcconfig

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
//
2+
// NOTE: DO NOT EDIT THIS FILE!
3+
// To specify additional custom SQLite compilation options, edit "SQLiteLib-Custom.xcconfig"
4+
//
5+
6+
#include "SQLiteLib-Custom.xcconfig"
7+
8+
// SQLiteLib targets OS X 10.9
9+
MACOSX_DEPLOYMENT_TARGET = 10.9
10+
11+
// SQLiteLib targets iOS 8.0
12+
IPHONEOS_DEPLOYMENT_TARGET = 8.0
13+
14+
// Supported platforms
15+
SUPPORTED_PLATFORMS = iphonesimulator macosx iphoneos appletvsimulator appletvos watchsimulator watchos
16+
17+
// Compilation options used by stock sqlite3 shipped with Apple operating systems
18+
//
19+
// Mac OSX 10.11.5:
20+
// ENABLE_API_ARMOR
21+
// ENABLE_FTS3
22+
// ENABLE_FTS3_PARENTHESIS
23+
// ENABLE_LOCKING_STYLE=1
24+
// ENABLE_RTREE
25+
// ENABLE_UPDATE_DELETE_LIMIT
26+
// OMIT_AUTORESET
27+
// OMIT_BUILTIN_TEST
28+
// OMIT_LOAD_EXTENSION
29+
// SYSTEM_MALLOC
30+
// THREADSAFE=2
31+
32+
// iOS 9.3.2:
33+
// ENABLE_API_ARMOR
34+
// ENABLE_FTS3
35+
// ENABLE_FTS3_PARENTHESIS
36+
// ENABLE_LOCKING_STYLE=1
37+
// ENABLE_RTREE
38+
// ENABLE_UPDATE_DELETE_LIMIT
39+
// MAX_MMAP_SIZE=0
40+
// OMIT_AUTORESET
41+
// OMIT_BUILTIN_TEST
42+
// OMIT_LOAD_EXTENSION
43+
// SYSTEM_MALLOC
44+
// THREADSAFE=2
45+
46+
// IMPORTANT:
47+
// The system SQLite library is compiled with SQLITE_ENABLE_LOCKING_STYLE=1 on both OSX 10.11 & iOS 9.0.
48+
// However, the SQLite code (verified in: 3.13.0) uses a deprecated function on iOS (gethostuuid()).
49+
//
50+
// D. Richard Hipp (SQLite architect), suggests working around this on iOS using -DSQLITE_ENABLE_LOCKING_STYLE=0
51+
// "The SQLITE_ENABLE_LOCKING_STYLE thing is an apple-only extension that
52+
// boosts performance when SQLite is used on a network filesystem. This
53+
// is important on MacOS because some users think it is a good idea to
54+
// put their home directory on a network filesystem.
55+
//
56+
// I'm guessing this is not really a factor on iOS."
57+
// Source: https://groups.google.com/forum/#!topic/sqlite-dev/7yjGulq3LmY
58+
// Via: https://github.com/clemensg/sqlite3pod/issues/1
59+
//
60+
// Thus, SQLITE_ENABLE_LOCKING_STYLE=1 is used on OSX,
61+
// and SQLITE_ENABLE_LOCKING_STYLE=0 on iOS/tvOS/watchOS.
62+
//
63+
// (Note: This doesn't get rid of the warning that "gethostuuid() is disabled" (as of 3.13.0). Uncomment the lines below to do so.)
64+
//
65+
// ↓ UNCOMMENT THE LINES BELOW to remove "gethostuuid() is disabled" warning on iOS/tvOS/watchOS.
66+
WARNING_CFLAGS[sdk=iphoneos*] = -Wno-#warnings
67+
WARNING_CFLAGS[sdk=iphonesimulator*] = -Wno-#warnings
68+
WARNING_CFLAGS[sdk=appletvos*] = -Wno-#warnings
69+
WARNING_CFLAGS[sdk=appletvsimulator*] = -Wno-#warnings
70+
WARNING_CFLAGS[sdk=watchos*] = -Wno-#warnings
71+
WARNING_CFLAGS[sdk=watchsimulator*] = -Wno-#warnings
72+
// ↑ UNCOMMENT THE LINES ABOVE to remove "gethostuuid() is disabled" warning on iOS/tvOS/watchOS.
73+
74+
// The common set of compilation options (on OSX and iOS).
75+
// NOTE: To add more compilation options, see SQLiteLibCustom.xcconfig.
76+
SQLLIBRARY_BASE_CFLAGS = -DSQLITE_ENABLE_API_ARMOR -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT -DSQLITE_OMIT_AUTORESET -DSQLITE_OMIT_BUILTIN_TEST -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_SYSTEM_MALLOC -DSQLITE_THREADSAFE=2 -DSQLITE_OS_UNIX=1 $(CUSTOM_SQLLIBRARY_CFLAGS)
77+
78+
SQLLIBRARY_OSX_ADDITIONAL_CFLAGS = -DSQLITE_ENABLE_LOCKING_STYLE=1
79+
SQLLIBRARY_IOS_ADDITIONAL_CFLAGS = -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_MAX_MMAP_SIZE=0
80+
SQLLIBRARY_RELEASE_CFLAGS = -DNDEBUG
81+
SQLLIBRARY_ARMV6_CFLAGS = -mno-thumb
82+
83+
SQLLIBRARY_CFLAGS = $(SQLLIBRARY_BASE_CFLAGS)
84+
SQLLIBRARY_CFLAGS[sdk=iphoneos*] = $(SQLLIBRARY_BASE_CFLAGS) $(SQLLIBRARY_IOS_ADDITIONAL_CFLAGS)
85+
SQLLIBRARY_CFLAGS[sdk=iphonesimulator*] = $(SQLLIBRARY_BASE_CFLAGS) $(SQLLIBRARY_IOS_ADDITIONAL_CFLAGS)
86+
SQLLIBRARY_CFLAGS[sdk=appletvos*] = $(SQLLIBRARY_BASE_CFLAGS) $(SQLLIBRARY_IOS_ADDITIONAL_CFLAGS)
87+
SQLLIBRARY_CFLAGS[sdk=appletvsimulator*] = $(SQLLIBRARY_BASE_CFLAGS) $(SQLLIBRARY_IOS_ADDITIONAL_CFLAGS)
88+
SQLLIBRARY_CFLAGS[sdk=watchos*] = $(SQLLIBRARY_BASE_CFLAGS) $(SQLLIBRARY_IOS_ADDITIONAL_CFLAGS)
89+
SQLLIBRARY_CFLAGS[sdk=watchsimulator*] = $(SQLLIBRARY_BASE_CFLAGS) $(SQLLIBRARY_IOS_ADDITIONAL_CFLAGS)
90+
SQLLIBRARY_CFLAGS[sdk=macosx*] = $(SQLLIBRARY_BASE_CFLAGS) $(SQLLIBRARY_OSX_ADDITIONAL_CFLAGS)
91+
92+
OTHER_CFLAGS = $(SQLLIBRARY_CFLAGS)
93+
OTHER_CFLAGS[arch=armv6] = $(SQLLIBRARY_ARMV6_CFLAGS) $(SQLLIBRARY_CFLAGS)
94+
OTHER_CFLAGS[config=Release] = $(SQLLIBRARY_CFLAGS) $(SQLLIBRARY_RELEASE_CFLAGS)
95+
OTHER_CFLAGS[config=Release][arch=armv6] = $(SQLLIBRARY_ARMV6_CFLAGS) $(SQLLIBRARY_CFLAGS) $(SQLLIBRARY_RELEASE_CFLAGS)

0 commit comments

Comments
 (0)