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',
123 ['OS == "mac" or OS == "ios"', {
126 '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
130 ['OS == "android"', {
133 'SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576',
134 'SQLITE_DEFAULT_AUTOVACUUM=1',
135 'SQLITE_TEMP_STORE=3',
136 'SQLITE_ENABLE_FTS3_BACKWARDS',
137 'DSQLITE_DEFAULT_FILE_FORMAT=4',
140 ['os_posix == 1 and OS != "mac" and OS != "android"', {
142 # SQLite doesn't believe in compiler warnings,
143 # preferring testing.
144 # http://www.sqlite.org/faq.html#q17
145 '-Wno-int-to-pointer-cast',
146 '-Wno-pointer-to-int-cast',
149 # Enable feedback-directed optimisation for sqlite when building in android.
150 ['android_webview_build == 1', {
151 'aosp_build_settings': {
152 'LOCAL_FDO_SUPPORT': 'true',
155 ['sqlite_enable_fts2', {
157 'SQLITE_ENABLE_BROKEN_FTS2',
158 'SQLITE_ENABLE_FTS2',
161 # fts2.c currently has a lot of conflicts when added to
162 # the amalgamation. It is probably not worth fixing that.
163 'src/ext/fts2/fts2.c',
164 'src/ext/fts2/fts2.h',
165 'src/ext/fts2/fts2_hash.c',
166 'src/ext/fts2/fts2_hash.h',
167 'src/ext/fts2/fts2_icu.c',
168 'src/ext/fts2/fts2_porter.c',
169 'src/ext/fts2/fts2_tokenizer.c',
170 'src/ext/fts2/fts2_tokenizer.h',
171 'src/ext/fts2/fts2_tokenizer1.c',
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',