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.
36 ['use_system_sqlite', {
38 'direct_dependent_settings': {
51 '$(SDKROOT)/usr/lib/libsqlite3.dylib',
55 ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android"', {
56 'direct_dependent_settings': {
58 # This next command produces no output but it it will fail
59 # (and cause GYP to fail) if we don't have a recent enough
61 '<!@(pkg-config --atleast-version=<(required_sqlite_version) sqlite3)',
63 '<!@(pkg-config --cflags sqlite3)',
68 '<!@(pkg-config --libs-only-L --libs-only-other sqlite3)',
71 '<!@(pkg-config --libs-only-l sqlite3)',
76 }, { # !use_system_sqlite
77 'product_name': 'sqlite3',
78 'type': 'static_library',
80 'amalgamation/sqlite3.h',
81 'amalgamation/sqlite3.c',
84 # TODO(shess): Previously fts1 and rtree files were
85 # explicitly excluded from the build. Make sure they are
86 # logically still excluded.
88 # TODO(shess): Should all of the sources be listed and then
89 # excluded? For editing purposes?
95 '../icu/icu.gyp:icui18n',
96 '../icu/icu.gyp:icuuc',
98 'direct_dependent_settings': {
104 'msvs_disabled_warnings': [
108 'clang_warning_flags': [
109 # sqlite does `if (*a++ && *b++);` in a non-buggy way.
111 # sqlite has some `unsigned < 0` checks.
112 '-Wno-tautological-compare',
113 # Needed because we don't have this commit yet:
114 # https://github.com/mackyle/sqlite/commit/25df0fa050dcc9be7fb937b8e25be24049b3fef0
115 '-Wno-pointer-bool-conversion',
126 ['OS == "mac" or OS == "ios"', {
129 '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
133 ['OS == "android"', {
136 'SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576',
137 'SQLITE_DEFAULT_AUTOVACUUM=1',
138 'SQLITE_TEMP_STORE=3',
139 'SQLITE_ENABLE_FTS3_BACKWARDS',
140 'DSQLITE_DEFAULT_FILE_FORMAT=4',
143 ['os_posix == 1 and OS != "mac" and OS != "android"', {
145 # SQLite doesn't believe in compiler warnings,
146 # preferring testing.
147 # http://www.sqlite.org/faq.html#q17
148 '-Wno-int-to-pointer-cast',
149 '-Wno-pointer-to-int-cast',
152 # Enable feedback-directed optimisation for sqlite when building in android.
153 ['android_webview_build == 1', {
154 'aosp_build_settings': {
155 'LOCAL_FDO_SUPPORT': 'true',
158 ['sqlite_enable_fts2', {
160 'SQLITE_ENABLE_BROKEN_FTS2',
161 'SQLITE_ENABLE_FTS2',
164 # fts2.c currently has a lot of conflicts when added to
165 # the amalgamation. It is probably not worth fixing that.
166 'src/ext/fts2/fts2.c',
167 'src/ext/fts2/fts2.h',
168 'src/ext/fts2/fts2_hash.c',
169 'src/ext/fts2/fts2_hash.h',
170 'src/ext/fts2/fts2_icu.c',
171 'src/ext/fts2/fts2_porter.c',
172 'src/ext/fts2/fts2_tokenizer.c',
173 'src/ext/fts2/fts2_tokenizer.h',
174 'src/ext/fts2/fts2_tokenizer1.c',
184 # Disable LTO due to ELF section name out of range
186 '../../build/android/disable_lto.gypi',
191 ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android" and not use_system_sqlite', {
194 'target_name': 'sqlite_shell',
195 'type': 'executable',
197 '../icu/icu.gyp:icuuc',
202 'src/src/shell_icu_linux.c',
203 # Include a dummy c++ file to force linking of libstdc++.
212 'target_name': 'sqlite_regexp',
213 'type': 'static_library',
215 '../icu/icu.gyp:icui18n',
216 '../icu/icu.gyp:icuuc',