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) { |
| 15 defines += [ |
| 16 "SQLITE_API=__declspec(dllimport)", |
| 17 ] |
| 18 } |
14 include_dirs = [ "." ] | 19 include_dirs = [ "." ] |
15 } | 20 } |
16 | 21 |
17 source_set("sqlite") { | 22 component("sqlite") { |
18 sources = [ | 23 sources = [ |
19 "amalgamation/sqlite3.c", | 24 "amalgamation/sqlite3.c", |
20 "amalgamation/sqlite3.h", | 25 "amalgamation/sqlite3.h", |
21 ] | 26 ] |
22 | 27 |
23 cflags = [] | 28 cflags = [] |
24 defines = [ | 29 defines = [ |
25 "SQLITE_ENABLE_FTS3", | 30 "SQLITE_ENABLE_FTS3", |
26 "SQLITE_DISABLE_FTS3_UNICODE", | 31 "SQLITE_DISABLE_FTS3_UNICODE", |
27 "SQLITE_DISABLE_FTS4_DEFERRED", | 32 "SQLITE_DISABLE_FTS4_DEFERRED", |
28 "SQLITE_ENABLE_ICU", | 33 "SQLITE_ENABLE_ICU", |
29 "SQLITE_ENABLE_MEMORY_MANAGEMENT", | 34 "SQLITE_ENABLE_MEMORY_MANAGEMENT", |
30 "SQLITE_SECURE_DELETE", | 35 "SQLITE_SECURE_DELETE", |
31 "SQLITE_SEPARATE_CACHE_POOLS", | 36 "SQLITE_SEPARATE_CACHE_POOLS", |
32 "THREADSAFE", | 37 "THREADSAFE", |
33 ] | 38 ] |
| 39 if (is_component_build) { |
| 40 if (is_win) { |
| 41 defines += [ |
| 42 "SQLITE_API=__declspec(dllexport)", |
| 43 ] |
| 44 } else { |
| 45 defines += [ |
| 46 "SQLITE_API=__attribute__((visibility(\"default\")))", |
| 47 ] |
| 48 } |
| 49 } |
34 if (is_chromeos) { | 50 if (is_chromeos) { |
35 defines += [ | 51 defines += [ |
36 # Despite obvious warnings about not using this flag in deployment, we | 52 # Despite obvious warnings about not using this flag in deployment, we |
37 # are turning off sync in ChromeOS and relying on the underlying | 53 # are turning off sync in ChromeOS and relying on the underlying |
38 # journaling filesystem to do error recovery properly. It's much faster. | 54 # journaling filesystem to do error recovery properly. It's much faster. |
39 "SQLITE_NO_SYNC", | 55 "SQLITE_NO_SYNC", |
40 ] | 56 ] |
41 } | 57 } |
42 if (is_posix) { | 58 if (is_posix) { |
43 defines += [ | 59 defines += [ |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 } | 94 } |
79 } | 95 } |
80 configs -= [ "//build/config/compiler:chromium_code" ] | 96 configs -= [ "//build/config/compiler:chromium_code" ] |
81 configs += [ "//build/config/compiler:no_chromium_code" ] | 97 configs += [ "//build/config/compiler:no_chromium_code" ] |
82 configs += [ ":sqlite_warnings" ] | 98 configs += [ ":sqlite_warnings" ] |
83 | 99 |
84 if (is_linux) { | 100 if (is_linux) { |
85 libs = [ "dl" ] | 101 libs = [ "dl" ] |
86 } else if (is_mac || is_ios) { | 102 } else if (is_mac || is_ios) { |
87 libs = [ "CoreFoundation.framework" ] | 103 libs = [ "CoreFoundation.framework" ] |
| 104 libs = [ "CoreServices.framework" ] |
88 } else if (is_android) { | 105 } else if (is_android) { |
89 defines += [ | 106 defines += [ |
90 "SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576", | 107 "SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576", |
91 "SQLITE_DEFAULT_AUTOVACUUM=1", | 108 "SQLITE_DEFAULT_AUTOVACUUM=1", |
92 "SQLITE_TEMP_STORE=3", | 109 "SQLITE_TEMP_STORE=3", |
93 "SQLITE_ENABLE_FTS3_BACKWARDS", | 110 "SQLITE_ENABLE_FTS3_BACKWARDS", |
94 "DSQLITE_DEFAULT_FILE_FORMAT=4", | 111 "DSQLITE_DEFAULT_FILE_FORMAT=4", |
95 ] | 112 ] |
96 } | 113 } |
97 | 114 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 "//third_party/icu", | 181 "//third_party/icu", |
165 ] | 182 ] |
166 if (is_clang) { | 183 if (is_clang) { |
167 # src/ext/icu/icu.c uses assert(!"string") which causes warnings about | 184 # src/ext/icu/icu.c uses assert(!"string") which causes warnings about |
168 # conversion from string literal to bool. | 185 # conversion from string literal to bool. |
169 configs -= [ "//build/config/clang:extra_warnings" ] | 186 configs -= [ "//build/config/clang:extra_warnings" ] |
170 } | 187 } |
171 } | 188 } |
172 } | 189 } |
173 } | 190 } |
OLD | NEW |