OLD | NEW |
---|---|
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 declare_args() { | 5 declare_args() { |
6 # Controls whether the build should uses the version of sqlite3 library | 6 # Controls whether the build should uses the version of sqlite3 library |
7 # shipped with the system (currently only supported on iOS) or the one | 7 # shipped with the system (currently only supported on iOS) or the one |
8 # shipped with Chromium source. | 8 # shipped with Chromium source. |
9 use_system_sqlite = is_ios | 9 use_system_sqlite = is_ios |
10 } | 10 } |
11 | 11 |
12 if (!use_system_sqlite) { | 12 if (!use_system_sqlite) { |
13 config("sqlite_config") { | 13 config("sqlite_config") { |
14 if (is_component_build && is_win) { | 14 if (is_component_build && is_win) { |
15 defines += [ | 15 defines = [ "SQLITE_API=__declspec(dllimport)" ] |
16 "SQLITE_API=__declspec(dllimport)", | |
17 ] | |
18 } | 16 } |
19 include_dirs = [ "." ] | 17 include_dirs = [ "." ] |
20 } | 18 } |
21 | 19 |
22 component("sqlite") { | 20 component("sqlite") { |
23 sources = [ | 21 sources = [ |
24 "amalgamation/sqlite3.c", | 22 "amalgamation/sqlite3.c", |
25 "amalgamation/sqlite3.h", | 23 "amalgamation/sqlite3.h", |
26 ] | 24 ] |
27 | 25 |
28 cflags = [] | 26 cflags = [] |
29 defines = [ | 27 defines = [ |
30 "SQLITE_ENABLE_FTS3", | 28 "SQLITE_ENABLE_FTS3", |
31 "SQLITE_DISABLE_FTS3_UNICODE", | 29 "SQLITE_DISABLE_FTS3_UNICODE", |
32 "SQLITE_DISABLE_FTS4_DEFERRED", | 30 "SQLITE_DISABLE_FTS4_DEFERRED", |
33 "SQLITE_ENABLE_ICU", | 31 "SQLITE_ENABLE_ICU", |
34 "SQLITE_ENABLE_MEMORY_MANAGEMENT", | 32 "SQLITE_ENABLE_MEMORY_MANAGEMENT", |
35 "SQLITE_SECURE_DELETE", | 33 "SQLITE_SECURE_DELETE", |
36 "SQLITE_SEPARATE_CACHE_POOLS", | 34 "SQLITE_SEPARATE_CACHE_POOLS", |
37 "THREADSAFE", | 35 "THREADSAFE", |
38 ] | 36 ] |
39 if (is_component_build) { | 37 if (is_component_build) { |
40 if (is_win) { | 38 if (is_win) { |
41 defines += [ | 39 defines += [ "SQLITE_API=__declspec(dllexport)" ] |
42 "SQLITE_API=__declspec(dllexport)", | 40 } else { |
43 ] | 41 defines += [ "SQLITE_API=__attribute__((visibility(\"default\")))" ] |
44 } else { | 42 } |
45 defines += [ | |
46 "SQLITE_API=__attribute__((visibility(\"default\")))", | |
47 ] | |
48 } | |
49 } | 43 } |
50 if (is_chromeos) { | 44 if (is_chromeos) { |
51 defines += [ | 45 defines += [ |
52 # Despite obvious warnings about not using this flag in deployment, we | 46 # Despite obvious warnings about not using this flag in deployment, we |
53 # are turning off sync in ChromeOS and relying on the underlying | 47 # are turning off sync in ChromeOS and relying on the underlying |
54 # journaling filesystem to do error recovery properly. It's much faster. | 48 # journaling filesystem to do error recovery properly. It's much faster. |
55 "SQLITE_NO_SYNC", | 49 "SQLITE_NO_SYNC", |
56 ] | 50 ] |
57 } | 51 } |
58 if (is_posix) { | 52 if (is_posix) { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
93 ] | 87 ] |
94 } | 88 } |
95 } | 89 } |
96 configs -= [ "//build/config/compiler:chromium_code" ] | 90 configs -= [ "//build/config/compiler:chromium_code" ] |
97 configs += [ "//build/config/compiler:no_chromium_code" ] | 91 configs += [ "//build/config/compiler:no_chromium_code" ] |
98 configs += [ ":sqlite_warnings" ] | 92 configs += [ ":sqlite_warnings" ] |
99 | 93 |
100 if (is_linux) { | 94 if (is_linux) { |
101 libs = [ "dl" ] | 95 libs = [ "dl" ] |
102 } else if (is_mac || is_ios) { | 96 } else if (is_mac || is_ios) { |
103 libs = [ "CoreFoundation.framework" ] | 97 libs = [ |
104 libs = [ "CoreServices.framework" ] | 98 "CoreFoundation.framework", |
99 "CoreServices.framework", | |
Nico
2015/08/28 17:41:54
whoops
| |
100 ] | |
105 } else if (is_android) { | 101 } else if (is_android) { |
106 defines += [ | 102 defines += [ |
107 "SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576", | 103 "SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576", |
108 "SQLITE_DEFAULT_AUTOVACUUM=1", | 104 "SQLITE_DEFAULT_AUTOVACUUM=1", |
109 "SQLITE_TEMP_STORE=3", | 105 "SQLITE_TEMP_STORE=3", |
110 "SQLITE_ENABLE_FTS3_BACKWARDS", | 106 "SQLITE_ENABLE_FTS3_BACKWARDS", |
111 "DSQLITE_DEFAULT_FILE_FORMAT=4", | 107 "DSQLITE_DEFAULT_FILE_FORMAT=4", |
112 ] | 108 ] |
113 } | 109 } |
114 | 110 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
181 "//third_party/icu", | 177 "//third_party/icu", |
182 ] | 178 ] |
183 if (is_clang) { | 179 if (is_clang) { |
184 # src/ext/icu/icu.c uses assert(!"string") which causes warnings about | 180 # src/ext/icu/icu.c uses assert(!"string") which causes warnings about |
185 # conversion from string literal to bool. | 181 # conversion from string literal to bool. |
186 configs -= [ "//build/config/clang:extra_warnings" ] | 182 configs -= [ "//build/config/clang:extra_warnings" ] |
187 } | 183 } |
188 } | 184 } |
189 } | 185 } |
190 } | 186 } |
OLD | NEW |