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 include_dirs = [ "." ] | 14 include_dirs = [ "." ] |
15 } | 15 } |
16 | 16 |
| 17 config("sqlite_warnings") { |
| 18 cflags = [] |
| 19 if (is_clang) { |
| 20 # sqlite contains a few functions that are unused, at least on |
| 21 # Windows with Chromium's sqlite patches applied |
| 22 # (interiorCursorEOF fts3EvalDeferredPhrase |
| 23 # fts3EvalSelectDeferred sqlite3Fts3InitHashTable |
| 24 # sqlite3Fts3InitTok). |
| 25 cflags += [ "-Wno-unused-function" ] |
| 26 } |
| 27 if (is_linux) { |
| 28 cflags += [ |
| 29 # SQLite doesn"t believe in compiler warnings, |
| 30 # preferring testing. |
| 31 # http://www.sqlite.org/faq.html#q17 |
| 32 "-Wno-int-to-pointer-cast", |
| 33 "-Wno-pointer-to-int-cast", |
| 34 ] |
| 35 } |
| 36 } |
| 37 |
17 source_set("sqlite") { | 38 source_set("sqlite") { |
18 sources = [ | 39 sources = [ |
19 "amalgamation/sqlite3.c", | 40 "amalgamation/sqlite3.c", |
20 "amalgamation/sqlite3.h", | 41 "amalgamation/sqlite3.h", |
21 ] | 42 ] |
22 | 43 |
23 cflags = [] | 44 cflags = [] |
24 defines = [ | 45 defines = [ |
25 "SQLITE_ENABLE_FTS3", | 46 "SQLITE_ENABLE_FTS3", |
26 "SQLITE_DISABLE_FTS3_UNICODE", | 47 "SQLITE_DISABLE_FTS3_UNICODE", |
(...skipping 23 matching lines...) Expand all Loading... |
50 } | 71 } |
51 if (is_linux || is_android) { | 72 if (is_linux || is_android) { |
52 defines += [ | 73 defines += [ |
53 # Linux provides fdatasync(), a faster equivalent of fsync(). | 74 # Linux provides fdatasync(), a faster equivalent of fsync(). |
54 "fdatasync=fdatasync", | 75 "fdatasync=fdatasync", |
55 ] | 76 ] |
56 } | 77 } |
57 | 78 |
58 include_dirs = [ "amalgamation" ] | 79 include_dirs = [ "amalgamation" ] |
59 | 80 |
60 config("sqlite_warnings") { | |
61 cflags = [] | |
62 if (is_clang) { | |
63 # sqlite contains a few functions that are unused, at least on | |
64 # Windows with Chromium's sqlite patches applied | |
65 # (interiorCursorEOF fts3EvalDeferredPhrase | |
66 # fts3EvalSelectDeferred sqlite3Fts3InitHashTable | |
67 # sqlite3Fts3InitTok). | |
68 cflags += [ "-Wno-unused-function" ] | |
69 } | |
70 if (is_linux) { | |
71 cflags += [ | |
72 # SQLite doesn"t believe in compiler warnings, | |
73 # preferring testing. | |
74 # http://www.sqlite.org/faq.html#q17 | |
75 "-Wno-int-to-pointer-cast", | |
76 "-Wno-pointer-to-int-cast", | |
77 ] | |
78 } | |
79 } | |
80 configs -= [ "//build/config/compiler:chromium_code" ] | 81 configs -= [ "//build/config/compiler:chromium_code" ] |
81 configs += [ "//build/config/compiler:no_chromium_code" ] | 82 configs += [ "//build/config/compiler:no_chromium_code" ] |
82 configs += [ ":sqlite_warnings" ] | 83 configs += [ ":sqlite_warnings" ] |
83 | 84 |
84 if (is_linux) { | 85 if (is_linux) { |
85 libs = [ "dl" ] | 86 libs = [ "dl" ] |
86 } else if (is_mac || is_ios) { | 87 } else if (is_mac || is_ios) { |
87 libs = [ "CoreFoundation.framework" ] | 88 libs = [ "CoreFoundation.framework" ] |
88 } else if (is_android) { | 89 } else if (is_android) { |
89 defines += [ | 90 defines += [ |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 "//third_party/icu", | 165 "//third_party/icu", |
165 ] | 166 ] |
166 if (is_clang) { | 167 if (is_clang) { |
167 # src/ext/icu/icu.c uses assert(!"string") which causes warnings about | 168 # src/ext/icu/icu.c uses assert(!"string") which causes warnings about |
168 # conversion from string literal to bool. | 169 # conversion from string literal to bool. |
169 configs -= [ "//build/config/clang:extra_warnings" ] | 170 configs -= [ "//build/config/clang:extra_warnings" ] |
170 } | 171 } |
171 } | 172 } |
172 } | 173 } |
173 } | 174 } |
OLD | NEW |