OLD | NEW |
(Empty) | |
| 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 |
| 3 # found in the LICENSE file. |
| 4 |
| 5 config("sqlite_config") { |
| 6 include_dirs = [ "." ] |
| 7 } |
| 8 |
| 9 source_set("sqlite") { |
| 10 sources = [ |
| 11 "amalgamation/sqlite3.h", |
| 12 "amalgamation/sqlite3.c", |
| 13 # fts2.c currently has a lot of conflicts when added to |
| 14 # the amalgamation. It is probably not worth fixing that. |
| 15 "src/ext/fts2/fts2.c", |
| 16 "src/ext/fts2/fts2.h", |
| 17 "src/ext/fts2/fts2_hash.c", |
| 18 "src/ext/fts2/fts2_hash.h", |
| 19 "src/ext/fts2/fts2_icu.c", |
| 20 "src/ext/fts2/fts2_porter.c", |
| 21 "src/ext/fts2/fts2_tokenizer.c", |
| 22 "src/ext/fts2/fts2_tokenizer.h", |
| 23 "src/ext/fts2/fts2_tokenizer1.c", |
| 24 ] |
| 25 |
| 26 cflags = [] |
| 27 defines = [ |
| 28 "SQLITE_CORE", |
| 29 "SQLITE_ENABLE_BROKEN_FTS2", |
| 30 "SQLITE_ENABLE_FTS2", |
| 31 "SQLITE_ENABLE_FTS3", |
| 32 "SQLITE_ENABLE_ICU", |
| 33 "SQLITE_ENABLE_MEMORY_MANAGEMENT", |
| 34 "SQLITE_SECURE_DELETE", |
| 35 "SQLITE_SEPARATE_CACHE_POOLS", |
| 36 "THREADSAFE", |
| 37 "_HAS_EXCEPTIONS=0", |
| 38 ] |
| 39 if (is_chromeos) { |
| 40 defines += [ |
| 41 # Despite obvious warnings about not using this flag in deployment, we |
| 42 # are turning off sync in ChromeOS and relying on the underlying |
| 43 # journaling filesystem to do error recovery properly. It's much faster. |
| 44 "SQLITE_NO_SYNC", |
| 45 ] |
| 46 } |
| 47 |
| 48 include_dirs = [ |
| 49 "amalgamation", |
| 50 "src/src", # Needed for fts2 to build. |
| 51 ] |
| 52 |
| 53 configs -= [ "//build/config/compiler:chromium_code" ] |
| 54 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 55 |
| 56 if (is_win) { |
| 57 cflags += [ "/wd4267" ] # Conversion from size_t to "type". |
| 58 } else if (is_linux) { |
| 59 cflags += [ |
| 60 # SQLite doesn"t believe in compiler warnings, |
| 61 # preferring testing. |
| 62 # http://www.sqlite.org/faq.html#q17 |
| 63 "-Wno-int-to-pointer-cast", |
| 64 "-Wno-pointer-to-int-cast", |
| 65 ] |
| 66 libs = [ "dl" ] |
| 67 } else if (is_mac || is_ios) { |
| 68 libs += [ "CoreFoundation.framework" ] |
| 69 } else if (is_android) { |
| 70 defines += [ |
| 71 "HAVE_USLEEP=1", |
| 72 "SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576", |
| 73 "SQLITE_DEFAULT_AUTOVACUUM=1", |
| 74 "SQLITE_TEMP_STORE=3", |
| 75 "SQLITE_ENABLE_FTS3_BACKWARDS", |
| 76 "DSQLITE_DEFAULT_FILE_FORMAT=4", |
| 77 ] |
| 78 } |
| 79 |
| 80 if (is_clang) { |
| 81 cflags += [ |
| 82 # sqlite does `if (*a++ && *b++);` in a non-buggy way. |
| 83 "-Wno-empty-body", |
| 84 # sqlite has some `unsigned < 0` checks. |
| 85 "-Wno-tautological-compare", |
| 86 ] |
| 87 } |
| 88 |
| 89 direct_dependent_configs = [ ":sqlite_config" ] |
| 90 |
| 91 deps = [ |
| 92 "//third_party/icu", |
| 93 ] |
| 94 } |
| 95 |
| 96 if (is_linux) { |
| 97 executable("sqlite_shell") { |
| 98 sources = [ |
| 99 "src/src/shell.c", |
| 100 "src/src/shell_icu_linux.c", |
| 101 # Include a dummy c++ file to force linking of libstdc++. |
| 102 "build_as_cpp.cc", |
| 103 ] |
| 104 |
| 105 deps = [ |
| 106 ":sqlite", |
| 107 "//third_party/icu", |
| 108 ] |
| 109 } |
| 110 } |
| 111 |
| 112 if (is_ios) { |
| 113 source_set("sqlite_regexp") { |
| 114 sources = [ "src/ext/icu/icu.c" ] |
| 115 deps = [ "//third_party/icu" ] |
| 116 } |
| 117 } |
OLD | NEW |