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',
15 'SQLITE_ENABLE_MEMORY_MANAGEMENT',
16 'SQLITE_SECURE_DELETE',
17 'SQLITE_SEPARATE_CACHE_POOLS',
24 'target_name': 'sqlite',
28 # Despite obvious warnings about not using this flag
29 # in deployment, we are turning off sync in ChromeOS
30 # and relying on the underlying journaling filesystem
31 # to do error recovery properly. It's much faster.
38 # Allow xSleep() call on Unix to use usleep() rather than sleep().
39 # Microsecond precision is better than second precision. Should
40 # only affect contended databases via the busy callback. Browser
41 # profile databases are mostly exclusive, but renderer databases may
42 # allow for contention.
46 ['use_system_sqlite', {
48 'direct_dependent_settings': {
61 '$(SDKROOT)/usr/lib/libsqlite3.dylib',
65 ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android"', {
66 'direct_dependent_settings': {
68 # This next command produces no output but it it will fail
69 # (and cause GYP to fail) if we don't have a recent enough
71 '<!@(pkg-config --atleast-version=<(required_sqlite_version) sqlite3)',
73 '<!@(pkg-config --cflags sqlite3)',
78 '<!@(pkg-config --libs-only-L --libs-only-other sqlite3)',
81 '<!@(pkg-config --libs-only-l sqlite3)',
86 }, { # !use_system_sqlite
87 'product_name': 'sqlite3',
88 'type': 'static_library',
90 'amalgamation/sqlite3.h',
91 'amalgamation/sqlite3.c',
94 # TODO(shess): Previously fts1 and rtree files were
95 # explicitly excluded from the build. Make sure they are
96 # logically still excluded.
98 # TODO(shess): Should all of the sources be listed and then
99 # excluded? For editing purposes?
105 '../icu/icu.gyp:icui18n',
106 '../icu/icu.gyp:icuuc',
108 'direct_dependent_settings': {
114 'msvs_disabled_warnings': [
118 'clang_warning_flags': [
119 # sqlite does `if (*a++ && *b++);` in a non-buggy way.
121 # sqlite has some `unsigned < 0` checks.
122 '-Wno-tautological-compare',
123 # Needed because we don't have this commit yet:
124 # https://github.com/mackyle/sqlite/commit/25df0fa050dcc9be7fb937b8e25be24049b3fef0
125 '-Wno-pointer-bool-conversion',
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',
167 ['sqlite_enable_fts2', {
169 'SQLITE_ENABLE_BROKEN_FTS2',
170 'SQLITE_ENABLE_FTS2',
173 # fts2.c currently has a lot of conflicts when added to
174 # the amalgamation. It is probably not worth fixing that.
175 'src/ext/fts2/fts2.c',
176 'src/ext/fts2/fts2.h',
177 'src/ext/fts2/fts2_hash.c',
178 'src/ext/fts2/fts2_hash.h',
179 'src/ext/fts2/fts2_icu.c',
180 'src/ext/fts2/fts2_porter.c',
181 'src/ext/fts2/fts2_tokenizer.c',
182 'src/ext/fts2/fts2_tokenizer.h',
183 'src/ext/fts2/fts2_tokenizer1.c',
193 # Disable LTO due to ELF section name out of range
195 '../../build/android/disable_lto.gypi',
200 ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android" and not use_system_sqlite', {
203 'target_name': 'sqlite_shell',
204 'type': 'executable',
206 '../icu/icu.gyp:icuuc',
211 'src/src/shell_icu_linux.c',
212 # Include a dummy c++ file to force linking of libstdc++.
221 'target_name': 'sqlite_regexp',
222 'type': 'static_library',
224 '../icu/icu.gyp:icui18n',
225 '../icu/icu.gyp:icuuc',