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 'SQLITE_ENABLE_BROKEN_FTS2',
17 'SQLITE_ENABLE_MEMORY_MANAGEMENT',
18 'SQLITE_SECURE_DELETE',
19 'SQLITE_SEPARATE_CACHE_POOLS',
26 'target_name': 'sqlite',
30 # Despite obvious warnings about not using this flag
31 # in deployment, we are turning off sync in ChromeOS
32 # and relying on the underlying journaling filesystem
33 # to do error recovery properly. It's much faster.
38 ['use_system_sqlite', {
40 'direct_dependent_settings': {
53 '$(SDKROOT)/usr/lib/libsqlite3.dylib',
57 ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android"', {
58 'direct_dependent_settings': {
60 # This next command produces no output but it it will fail
61 # (and cause GYP to fail) if we don't have a recent enough
63 '<!@(pkg-config --atleast-version=<(required_sqlite_version) sqlite3)',
65 '<!@(pkg-config --cflags sqlite3)',
70 '<!@(pkg-config --libs-only-L --libs-only-other sqlite3)',
73 '<!@(pkg-config --libs-only-l sqlite3)',
78 }, { # !use_system_sqlite
79 'product_name': 'sqlite3',
80 'type': 'static_library',
82 'amalgamation/sqlite3.h',
83 'amalgamation/sqlite3.c',
84 # fts2.c currently has a lot of conflicts when added to
85 # the amalgamation. It is probably not worth fixing that.
86 'src/ext/fts2/fts2.c',
87 'src/ext/fts2/fts2.h',
88 'src/ext/fts2/fts2_hash.c',
89 'src/ext/fts2/fts2_hash.h',
90 'src/ext/fts2/fts2_icu.c',
91 'src/ext/fts2/fts2_porter.c',
92 'src/ext/fts2/fts2_tokenizer.c',
93 'src/ext/fts2/fts2_tokenizer.h',
94 'src/ext/fts2/fts2_tokenizer1.c',
97 # TODO(shess): Previously fts1 and rtree files were
98 # explicitly excluded from the build. Make sure they are
99 # logically still excluded.
101 # TODO(shess): Should all of the sources be listed and then
102 # excluded? For editing purposes?
106 # Needed for fts2 to build.
110 '../icu/icu.gyp:icui18n',
111 '../icu/icu.gyp:icuuc',
113 'direct_dependent_settings': {
119 'msvs_disabled_warnings': [
130 ['OS == "mac" or OS == "ios"', {
133 '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
137 ['OS == "android"', {
140 'SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576',
141 'SQLITE_DEFAULT_AUTOVACUUM=1',
142 'SQLITE_TEMP_STORE=3',
143 'SQLITE_ENABLE_FTS3_BACKWARDS',
144 'DSQLITE_DEFAULT_FILE_FORMAT=4',
147 ['os_posix == 1 and OS != "mac" and OS != "android"', {
149 # SQLite doesn't believe in compiler warnings,
150 # preferring testing.
151 # http://www.sqlite.org/faq.html#q17
152 '-Wno-int-to-pointer-cast',
153 '-Wno-pointer-to-int-cast',
159 # sqlite does `if (*a++ && *b++);` in a non-buggy way.
161 # sqlite has some `unsigned < 0` checks.
162 '-Wno-tautological-compare',
167 '-Wno-tautological-compare',
176 ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android" and not use_system_sqlite', {
179 'target_name': 'sqlite_shell',
180 'type': 'executable',
182 '../icu/icu.gyp:icuuc',
187 'src/src/shell_icu_linux.c',
188 # Include a dummy c++ file to force linking of libstdc++.
197 'target_name': 'sqlite_regexp',
198 'type': 'static_library',
200 '../icu/icu.gyp:icui18n',
201 '../icu/icu.gyp:icuuc',