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',
14 # New unicode61 tokenizer with built-in tables.
15 'SQLITE_DISABLE_FTS3_UNICODE',
16 # Chromium currently does not enable fts4, disable extra code.
17 'SQLITE_DISABLE_FTS4_DEFERRED',
19 'SQLITE_ENABLE_MEMORY_MANAGEMENT',
20 'SQLITE_SECURE_DELETE',
21 # Custom flag to tweak pcache pools.
22 # TODO(shess): This shouldn't use faux-SQLite naming.
23 'SQLITE_SEPARATE_CACHE_POOLS',
24 # TODO(shess): SQLite adds mutexes to protect structures which cross
25 # threads. In theory Chromium should be able to turn this off for a
28 # TODO(shess): Figure out why this is here. Nobody references it
31 # NOTE(shess): Some defines can affect the amalgamation. Those should be
32 # added to google_generate_amalgamation.sh, and the amalgamation
33 # re-generated. Usually this involves disabling features which include
34 # keywords or syntax, for instance SQLITE_OMIT_VIRTUALTABLE omits the
35 # virtual table syntax entirely. Missing an item usually results in
36 # syntax working but execution failing. Review:
38 # src/tool/mkkeywordhash.c
43 'target_name': 'sqlite',
47 # Despite obvious warnings about not using this flag
48 # in deployment, we are turning off sync in ChromeOS
49 # and relying on the underlying journaling filesystem
50 # to do error recovery properly. It's much faster.
57 # Allow xSleep() call on Unix to use usleep() rather than sleep().
58 # Microsecond precision is better than second precision. Should
59 # only affect contended databases via the busy callback. Browser
60 # profile databases are mostly exclusive, but renderer databases may
61 # allow for contention.
65 ['use_system_sqlite', {
67 'direct_dependent_settings': {
80 '$(SDKROOT)/usr/lib/libsqlite3.dylib',
84 ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android"', {
85 'direct_dependent_settings': {
87 # This next command produces no output but it it will fail
88 # (and cause GYP to fail) if we don't have a recent enough
90 '<!@(pkg-config --atleast-version=<(required_sqlite_version) sqlite3)',
92 '<!@(pkg-config --cflags sqlite3)',
97 '<!@(pkg-config --libs-only-L --libs-only-other sqlite3)',
100 '<!@(pkg-config --libs-only-l sqlite3)',
105 }, { # !use_system_sqlite
106 'product_name': 'sqlite3',
107 'type': 'static_library',
109 'amalgamation/sqlite3.h',
110 'amalgamation/sqlite3.c',
116 '../icu/icu.gyp:icui18n',
117 '../icu/icu.gyp:icuuc',
119 'direct_dependent_settings': {
125 'msvs_disabled_warnings': [
136 ['OS == "mac" or OS == "ios"', {
139 '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
143 ['OS == "android"', {
145 'SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576',
146 'SQLITE_DEFAULT_AUTOVACUUM=1',
147 'SQLITE_TEMP_STORE=3',
148 'SQLITE_ENABLE_FTS3_BACKWARDS',
149 'SQLITE_DEFAULT_FILE_FORMAT=4',
152 ['os_posix == 1 and OS != "mac" and OS != "android"', {
154 # SQLite doesn't believe in compiler warnings,
155 # preferring testing.
156 # http://www.sqlite.org/faq.html#q17
157 '-Wno-int-to-pointer-cast',
158 '-Wno-pointer-to-int-cast',
161 # Enable feedback-directed optimisation for sqlite when building in android.
162 ['android_webview_build == 1', {
163 'aosp_build_settings': {
164 'LOCAL_FDO_SUPPORT': 'true',
171 # Disable LTO due to ELF section name out of range
173 '../../build/android/disable_lto.gypi',
178 ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android" and not use_system_sqlite', {
181 'target_name': 'sqlite_shell',
182 'type': 'executable',
184 '../icu/icu.gyp:icuuc',
189 'src/src/shell_icu_linux.c',
190 # Include a dummy c++ file to force linking of libstdc++.
199 'target_name': 'sqlite_regexp',
200 'type': 'static_library',
202 '../icu/icu.gyp:icui18n',
203 '../icu/icu.gyp:icuuc',