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 # TODO(shess): This cannot possibly be the right thing to do. AFAICT it is | |
14 # only necessary so that WebDatabase can #include <sqlite3.h>. | |
13 config("sqlite_config") { | 15 config("sqlite_config") { |
14 include_dirs = [ "." ] | 16 include_dirs = [ "." ] |
brettw
2015/08/31 20:56:59
I think you can just add this to the sqlite_export
Scott Hess - ex-Googler
2015/08/31 21:06:49
I probably could, but I've become very conservativ
brettw
2015/08/31 21:11:05
Can you do that as a followup?
Scott Hess - ex-Googler
2015/08/31 21:15:58
Definitely, http://crbug.com/526828
| |
15 } | 17 } |
16 | 18 |
17 source_set("sqlite") { | 19 component("sqlite_build") { |
20 visibility = [ ":*" ] | |
21 | |
18 sources = [ | 22 sources = [ |
19 "amalgamation/sqlite3.c", | 23 "amalgamation/sqlite3.c", |
20 "amalgamation/sqlite3.h", | 24 "amalgamation/sqlite3.h", |
21 ] | 25 ] |
22 | 26 |
23 cflags = [] | 27 cflags = [] |
24 defines = [ | 28 defines = [ |
25 "SQLITE_ENABLE_FTS3", | 29 "SQLITE_ENABLE_FTS3", |
26 "SQLITE_DISABLE_FTS3_UNICODE", | 30 "SQLITE_DISABLE_FTS3_UNICODE", |
27 "SQLITE_DISABLE_FTS4_DEFERRED", | 31 "SQLITE_DISABLE_FTS4_DEFERRED", |
28 "SQLITE_ENABLE_ICU", | 32 "SQLITE_ENABLE_ICU", |
29 "SQLITE_ENABLE_MEMORY_MANAGEMENT", | 33 "SQLITE_ENABLE_MEMORY_MANAGEMENT", |
30 "SQLITE_SECURE_DELETE", | 34 "SQLITE_SECURE_DELETE", |
31 "SQLITE_SEPARATE_CACHE_POOLS", | 35 "SQLITE_SEPARATE_CACHE_POOLS", |
32 "THREADSAFE", | 36 "THREADSAFE", |
33 ] | 37 ] |
38 if (is_component_build) { | |
39 if (is_win) { | |
40 defines += [ "SQLITE_API=__declspec(dllexport)" ] | |
41 } else { | |
42 defines += [ "SQLITE_API=__attribute__((visibility(\"default\")))" ] | |
43 } | |
44 } | |
34 if (is_chromeos) { | 45 if (is_chromeos) { |
35 defines += [ | 46 defines += [ |
36 # Despite obvious warnings about not using this flag in deployment, we | 47 # Despite obvious warnings about not using this flag in deployment, we |
37 # are turning off sync in ChromeOS and relying on the underlying | 48 # are turning off sync in ChromeOS and relying on the underlying |
38 # journaling filesystem to do error recovery properly. It's much faster. | 49 # journaling filesystem to do error recovery properly. It's much faster. |
39 "SQLITE_NO_SYNC", | 50 "SQLITE_NO_SYNC", |
40 ] | 51 ] |
41 } | 52 } |
42 if (is_posix) { | 53 if (is_posix) { |
43 defines += [ | 54 defines += [ |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
77 ] | 88 ] |
78 } | 89 } |
79 } | 90 } |
80 configs -= [ "//build/config/compiler:chromium_code" ] | 91 configs -= [ "//build/config/compiler:chromium_code" ] |
81 configs += [ "//build/config/compiler:no_chromium_code" ] | 92 configs += [ "//build/config/compiler:no_chromium_code" ] |
82 configs += [ ":sqlite_warnings" ] | 93 configs += [ ":sqlite_warnings" ] |
83 | 94 |
84 if (is_linux) { | 95 if (is_linux) { |
85 libs = [ "dl" ] | 96 libs = [ "dl" ] |
86 } else if (is_mac || is_ios) { | 97 } else if (is_mac || is_ios) { |
87 libs = [ "CoreFoundation.framework" ] | 98 libs = [ |
99 "CoreFoundation.framework", | |
100 "CoreServices.framework", | |
101 ] | |
88 } else if (is_android) { | 102 } else if (is_android) { |
89 defines += [ | 103 defines += [ |
90 "SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576", | 104 "SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576", |
91 "SQLITE_DEFAULT_AUTOVACUUM=1", | 105 "SQLITE_DEFAULT_AUTOVACUUM=1", |
92 "SQLITE_TEMP_STORE=3", | 106 "SQLITE_TEMP_STORE=3", |
93 "SQLITE_ENABLE_FTS3_BACKWARDS", | 107 "SQLITE_ENABLE_FTS3_BACKWARDS", |
94 "DSQLITE_DEFAULT_FILE_FORMAT=4", | 108 "DSQLITE_DEFAULT_FILE_FORMAT=4", |
95 ] | 109 ] |
96 } | 110 } |
97 | 111 |
98 deps = [ | 112 deps = [ |
99 "//third_party/icu", | 113 "//third_party/icu", |
100 ] | 114 ] |
115 } | |
101 | 116 |
102 public_configs = [ ":sqlite_config" ] | 117 config("sqlite_export") { |
118 if (is_component_build && is_win) { | |
119 defines = [ "SQLITE_API=__declspec(dllimport)" ] | |
120 } | |
121 } | |
122 | |
123 group("sqlite") { | |
brettw
2015/08/31 20:56:59
It might be nice to add a comment about why this i
Scott Hess - ex-Googler
2015/08/31 21:06:49
Acknowledged.
| |
124 public_deps = [ ":sqlite_build" ] | |
125 public_configs = [ ":sqlite_export", ":sqlite_config" ] | |
103 } | 126 } |
104 | 127 |
105 if (is_linux) { | 128 if (is_linux) { |
106 executable("sqlite_shell") { | 129 executable("sqlite_shell") { |
107 sources = [ | 130 sources = [ |
108 "src/src/shell.c", | 131 "src/src/shell.c", |
109 "src/src/shell_icu_linux.c", | 132 "src/src/shell_icu_linux.c", |
110 | 133 |
111 # Include a dummy c++ file to force linking of libstdc++. | 134 # Include a dummy c++ file to force linking of libstdc++. |
112 "build_as_cpp.cc", | 135 "build_as_cpp.cc", |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
164 "//third_party/icu", | 187 "//third_party/icu", |
165 ] | 188 ] |
166 if (is_clang) { | 189 if (is_clang) { |
167 # src/ext/icu/icu.c uses assert(!"string") which causes warnings about | 190 # src/ext/icu/icu.c uses assert(!"string") which causes warnings about |
168 # conversion from string literal to bool. | 191 # conversion from string literal to bool. |
169 configs -= [ "//build/config/clang:extra_warnings" ] | 192 configs -= [ "//build/config/clang:extra_warnings" ] |
170 } | 193 } |
171 } | 194 } |
172 } | 195 } |
173 } | 196 } |
OLD | NEW |