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 # TODO(shess): Figure out why this is here. Nobody references it
30 # NOTE(shess): Some defines can affect the amalgamation. Those should be
31 # added to google_generate_amalgamation.sh, and the amalgamation
32 # re-generated. Usually this involves disabling features which include
33 # keywords or syntax, for instance SQLITE_OMIT_VIRTUALTABLE omits the
34 # virtual table syntax entirely. Missing an item usually results in
35 # syntax working but execution failing. Review:
37 # src/tool/mkkeywordhash.c
42 'target_name': 'sqlite',
46 # Despite obvious warnings about not using this flag
47 # in deployment, we are turning off sync in ChromeOS
48 # and relying on the underlying journaling filesystem
49 # to do error recovery properly. It's much faster.
56 # Allow xSleep() call on Unix to use usleep() rather than sleep().
57 # Microsecond precision is better than second precision. Should
58 # only affect contended databases via the busy callback. Browser
59 # profile databases are mostly exclusive, but renderer databases may
60 # allow for contention.
64 ['OS == "linux" or OS == "android"', {
66 # Linux provides fdatasync(), a faster equivalent of fsync().
67 'fdatasync=fdatasync',
70 ['use_system_sqlite', {
72 'direct_dependent_settings': {
85 '$(SDKROOT)/usr/lib/libsqlite3.dylib',
89 ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android"', {
90 'direct_dependent_settings': {
92 # This next command produces no output but it it will fail
93 # (and cause GYP to fail) if we don't have a recent enough
95 '<!@(pkg-config --atleast-version=<(required_sqlite_version) sqlite3)',
97 '<!@(pkg-config --cflags sqlite3)',
102 '<!@(pkg-config --libs-only-L --libs-only-other sqlite3)',
105 '<!@(pkg-config --libs-only-l sqlite3)',
110 }, { # !use_system_sqlite
111 'product_name': 'sqlite3',
112 'type': 'static_library',
114 'amalgamation/sqlite3.h',
115 'amalgamation/sqlite3.c',
121 '../icu/icu.gyp:icui18n',
122 '../icu/icu.gyp:icuuc',
124 'direct_dependent_settings': {
130 'msvs_disabled_warnings': [
141 ['OS == "mac" or OS == "ios"', {
144 '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
148 ['OS == "android"', {
150 'SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576',
151 'SQLITE_DEFAULT_AUTOVACUUM=1',
152 'SQLITE_TEMP_STORE=3',
153 'SQLITE_ENABLE_FTS3_BACKWARDS',
154 'SQLITE_DEFAULT_FILE_FORMAT=4',
157 ['os_posix == 1 and OS != "mac" and OS != "android"', {
159 # SQLite doesn't believe in compiler warnings,
160 # preferring testing.
161 # http://www.sqlite.org/faq.html#q17
162 '-Wno-int-to-pointer-cast',
163 '-Wno-pointer-to-int-cast',
170 # Disable LTO due to ELF section name out of range
172 '../../build/android/disable_lto.gypi',
177 ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android" and not use_system_sqlite', {
180 'target_name': 'sqlite_shell',
181 'type': 'executable',
183 '../icu/icu.gyp:icuuc',
188 'src/src/shell_icu_linux.c',
189 # Include a dummy c++ file to force linking of libstdc++.
198 'target_name': 'sqlite_regexp',
199 'type': 'static_library',
201 '../icu/icu.gyp:icui18n',
202 '../icu/icu.gyp:icuuc',
205 # Necessary to statically compile the extension.