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 | 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>. | 14 # only necessary so that WebDatabase can #include <sqlite3.h>. |
15 config("sqlite_config") { | 15 config("sqlite_config") { |
16 include_dirs = [ "." ] | 16 include_dirs = [ "." ] |
17 } | 17 } |
18 | 18 |
| 19 config("sqlite_warnings") { |
| 20 cflags = [] |
| 21 if (is_clang) { |
| 22 # sqlite contains a few functions that are unused, at least on |
| 23 # Windows with Chromium's sqlite patches applied |
| 24 # (interiorCursorEOF fts3EvalDeferredPhrase |
| 25 # fts3EvalSelectDeferred sqlite3Fts3InitHashTable |
| 26 # sqlite3Fts3InitTok). |
| 27 cflags += [ "-Wno-unused-function" ] |
| 28 } |
| 29 if (is_linux) { |
| 30 cflags += [ |
| 31 # SQLite doesn"t believe in compiler warnings, |
| 32 # preferring testing. |
| 33 # http://www.sqlite.org/faq.html#q17 |
| 34 "-Wno-int-to-pointer-cast", |
| 35 "-Wno-pointer-to-int-cast", |
| 36 ] |
| 37 } |
| 38 } |
| 39 |
19 # "sqlite3" can cause conflicts with the system library. | 40 # "sqlite3" can cause conflicts with the system library. |
20 component("chromium_sqlite3") { | 41 component("chromium_sqlite3") { |
21 visibility = [ ":*" ] | 42 visibility = [ ":*" ] |
22 | 43 |
23 sources = [ | 44 sources = [ |
24 "amalgamation/sqlite3.c", | 45 "amalgamation/sqlite3.c", |
25 "amalgamation/sqlite3.h", | 46 "amalgamation/sqlite3.h", |
26 ] | 47 ] |
27 | 48 |
28 cflags = [] | 49 cflags = [] |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 } | 83 } |
63 if (is_linux || is_android) { | 84 if (is_linux || is_android) { |
64 defines += [ | 85 defines += [ |
65 # Linux provides fdatasync(), a faster equivalent of fsync(). | 86 # Linux provides fdatasync(), a faster equivalent of fsync(). |
66 "fdatasync=fdatasync", | 87 "fdatasync=fdatasync", |
67 ] | 88 ] |
68 } | 89 } |
69 | 90 |
70 include_dirs = [ "amalgamation" ] | 91 include_dirs = [ "amalgamation" ] |
71 | 92 |
72 config("sqlite_warnings") { | |
73 cflags = [] | |
74 if (is_clang) { | |
75 # sqlite contains a few functions that are unused, at least on | |
76 # Windows with Chromium's sqlite patches applied | |
77 # (interiorCursorEOF fts3EvalDeferredPhrase | |
78 # fts3EvalSelectDeferred sqlite3Fts3InitHashTable | |
79 # sqlite3Fts3InitTok). | |
80 cflags += [ "-Wno-unused-function" ] | |
81 } | |
82 if (is_linux) { | |
83 cflags += [ | |
84 # SQLite doesn"t believe in compiler warnings, | |
85 # preferring testing. | |
86 # http://www.sqlite.org/faq.html#q17 | |
87 "-Wno-int-to-pointer-cast", | |
88 "-Wno-pointer-to-int-cast", | |
89 ] | |
90 } | |
91 } | |
92 configs -= [ "//build/config/compiler:chromium_code" ] | 93 configs -= [ "//build/config/compiler:chromium_code" ] |
93 configs += [ "//build/config/compiler:no_chromium_code" ] | 94 configs += [ |
94 configs += [ ":sqlite_warnings" ] | 95 "//build/config/compiler:no_chromium_code", |
| 96 |
| 97 # Must be after no_chromium_code for warning flags to be ordered |
| 98 # correctly. |
| 99 ":sqlite_warnings", |
| 100 ] |
95 | 101 |
96 if (is_linux) { | 102 if (is_linux) { |
97 libs = [ "dl" ] | 103 libs = [ "dl" ] |
98 } else if (is_mac || is_ios) { | 104 } else if (is_mac || is_ios) { |
99 libs = [ | 105 libs = [ |
100 "CoreFoundation.framework", | 106 "CoreFoundation.framework", |
101 "CoreServices.framework", | 107 "CoreServices.framework", |
102 ] | 108 ] |
103 } else if (is_android) { | 109 } else if (is_android) { |
104 defines += [ | 110 defines += [ |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 "//third_party/icu", | 197 "//third_party/icu", |
192 ] | 198 ] |
193 if (is_clang) { | 199 if (is_clang) { |
194 # src/ext/icu/icu.c uses assert(!"string") which causes warnings about | 200 # src/ext/icu/icu.c uses assert(!"string") which causes warnings about |
195 # conversion from string literal to bool. | 201 # conversion from string literal to bool. |
196 configs -= [ "//build/config/clang:extra_warnings" ] | 202 configs -= [ "//build/config/clang:extra_warnings" ] |
197 } | 203 } |
198 } | 204 } |
199 } | 205 } |
200 } | 206 } |
OLD | NEW |