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 | |
38 source_set("sqlite") { | 17 source_set("sqlite") { |
39 sources = [ | 18 sources = [ |
40 "amalgamation/sqlite3.c", | 19 "amalgamation/sqlite3.c", |
41 "amalgamation/sqlite3.h", | 20 "amalgamation/sqlite3.h", |
42 ] | 21 ] |
43 | 22 |
44 cflags = [] | 23 cflags = [] |
45 defines = [ | 24 defines = [ |
46 "SQLITE_ENABLE_FTS3", | 25 "SQLITE_ENABLE_FTS3", |
47 "SQLITE_DISABLE_FTS3_UNICODE", | 26 "SQLITE_DISABLE_FTS3_UNICODE", |
(...skipping 23 matching lines...) Expand all Loading... |
71 } | 50 } |
72 if (is_linux || is_android) { | 51 if (is_linux || is_android) { |
73 defines += [ | 52 defines += [ |
74 # Linux provides fdatasync(), a faster equivalent of fsync(). | 53 # Linux provides fdatasync(), a faster equivalent of fsync(). |
75 "fdatasync=fdatasync", | 54 "fdatasync=fdatasync", |
76 ] | 55 ] |
77 } | 56 } |
78 | 57 |
79 include_dirs = [ "amalgamation" ] | 58 include_dirs = [ "amalgamation" ] |
80 | 59 |
| 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 } |
81 configs -= [ "//build/config/compiler:chromium_code" ] | 80 configs -= [ "//build/config/compiler:chromium_code" ] |
82 configs += [ "//build/config/compiler:no_chromium_code" ] | 81 configs += [ "//build/config/compiler:no_chromium_code" ] |
83 configs += [ ":sqlite_warnings" ] | 82 configs += [ ":sqlite_warnings" ] |
84 | 83 |
85 if (is_linux) { | 84 if (is_linux) { |
86 libs = [ "dl" ] | 85 libs = [ "dl" ] |
87 } else if (is_mac || is_ios) { | 86 } else if (is_mac || is_ios) { |
88 libs = [ "CoreFoundation.framework" ] | 87 libs = [ "CoreFoundation.framework" ] |
89 } else if (is_android) { | 88 } else if (is_android) { |
90 defines += [ | 89 defines += [ |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 "//third_party/icu", | 164 "//third_party/icu", |
166 ] | 165 ] |
167 if (is_clang) { | 166 if (is_clang) { |
168 # src/ext/icu/icu.c uses assert(!"string") which causes warnings about | 167 # src/ext/icu/icu.c uses assert(!"string") which causes warnings about |
169 # conversion from string literal to bool. | 168 # conversion from string literal to bool. |
170 configs -= [ "//build/config/clang:extra_warnings" ] | 169 configs -= [ "//build/config/clang:extra_warnings" ] |
171 } | 170 } |
172 } | 171 } |
173 } | 172 } |
174 } | 173 } |
OLD | NEW |