1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
7 'use_system_sqlite%': 0,
8 'required_sqlite_version': '3.6.1',
13 # New unicode61 tokenizer with built-in tables.
14 'SQLITE_DISABLE_FTS3_UNICODE',
15 # Chromium currently does not enable fts4, disable extra code.
16 'SQLITE_DISABLE_FTS4_DEFERRED',
18 'SQLITE_ENABLE_MEMORY_MANAGEMENT',
19 'SQLITE_SECURE_DELETE',
20 # Custom flag to tweak pcache pools.
21 # TODO(shess): This shouldn't use faux-SQLite naming.
22 'SQLITE_SEPARATE_CACHE_POOLS',
23 # TODO(shess): SQLite adds mutexes to protect structures which cross
24 # threads. In theory Chromium should be able to turn this off for a
27 # SQLite can spawn threads to sort in parallel if configured
28 # appropriately. Chromium doesn't configure SQLite for that, and would
29 # prefer to control distribution to worker threads.
30 'SQLITE_MAX_WORKER_THREADS=0',
31 # TODO(shess): Figure out why this is here. Nobody references it
34 # NOTE(shess): Some defines can affect the amalgamation. Those should be
35 # added to google_generate_amalgamation.sh, and the amalgamation
36 # re-generated. Usually this involves disabling features which include
37 # keywords or syntax, for instance SQLITE_OMIT_VIRTUALTABLE omits the
38 # virtual table syntax entirely. Missing an item usually results in
39 # syntax working but execution failing. Review:
41 # src/tool/mkkeywordhash.c
46 'target_name': 'sqlite',
50 # Despite obvious warnings about not using this flag
51 # in deployment, we are turning off sync in ChromeOS
52 # and relying on the underlying journaling filesystem
53 # to do error recovery properly. It's much faster.
60 # Allow xSleep() call on Unix to use usleep() rather than sleep().
61 # Microsecond precision is better than second precision. Should
62 # only affect contended databases via the busy callback. Browser
63 # profile databases are mostly exclusive, but renderer databases may
64 # allow for contention.
68 ['OS == "linux" or OS == "android"', {
70 # Linux provides fdatasync(), a faster equivalent of fsync().
71 'fdatasync=fdatasync',
74 ['use_system_sqlite', {
76 'direct_dependent_settings': {
95 ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android"', {
96 'direct_dependent_settings': {
98 # This next command produces no output but it it will fail
99 # (and cause GYP to fail) if we don't have a recent enough
101 '<!@(pkg-config --atleast-version=<(required_sqlite_version) sqlite3)',
103 '<!@(pkg-config --cflags sqlite3)',
108 '<!@(pkg-config --libs-only-L --libs-only-other sqlite3)',
111 '<!@(pkg-config --libs-only-l sqlite3)',
116 }, { # !use_system_sqlite
117 'product_name': 'sqlite3',
118 'type': 'static_library',
120 'amalgamation/sqlite3.h',
121 'amalgamation/sqlite3.c',
127 '../icu/icu.gyp:icui18n',
128 '../icu/icu.gyp:icuuc',
130 'direct_dependent_settings': {
136 'msvs_disabled_warnings': [
147 ['OS == "mac" or OS == "ios"', {
150 '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
154 ['OS == "android"', {
156 'SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576',
157 'SQLITE_DEFAULT_AUTOVACUUM=1',
158 'SQLITE_TEMP_STORE=3',
159 'SQLITE_ENABLE_FTS3_BACKWARDS',
160 'SQLITE_DEFAULT_FILE_FORMAT=4',
163 ['os_posix == 1 and OS != "mac" and OS != "android"', {
165 # SQLite doesn't believe in compiler warnings,
166 # preferring testing.
167 # http://www.sqlite.org/faq.html#q17
168 '-Wno-int-to-pointer-cast',
169 '-Wno-pointer-to-int-cast',
176 # Disable LTO due to ELF section name out of range
178 '../../build/android/disable_lto.gypi',
183 ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android" and not use_system_sqlite', {
186 'target_name': 'sqlite_shell',
187 'type': 'executable',
189 '../icu/icu.gyp:icuuc',
194 'src/src/shell_icu_linux.c',
195 # Include a dummy c++ file to force linking of libstdc++.
204 'target_name': 'sqlite_regexp',
205 'type': 'static_library',
207 '../icu/icu.gyp:icui18n',
208 '../icu/icu.gyp:icuuc',
211 # Necessary to statically compile the extension.