| 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 config("sqlite_config") { | 5 config("sqlite_config") { |
| 6 include_dirs = [ "." ] | 6 include_dirs = [ "." ] |
| 7 } | 7 } |
| 8 | 8 |
| 9 source_set("sqlite") { | 9 source_set("sqlite") { |
| 10 sources = [ | 10 sources = [ |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 "src/ext/fts2/fts2_tokenizer.h", | 23 "src/ext/fts2/fts2_tokenizer.h", |
| 24 "src/ext/fts2/fts2_tokenizer1.c", | 24 "src/ext/fts2/fts2_tokenizer1.c", |
| 25 ] | 25 ] |
| 26 | 26 |
| 27 cflags = [] | 27 cflags = [] |
| 28 defines = [ | 28 defines = [ |
| 29 "SQLITE_CORE", | 29 "SQLITE_CORE", |
| 30 "SQLITE_ENABLE_BROKEN_FTS2", | 30 "SQLITE_ENABLE_BROKEN_FTS2", |
| 31 "SQLITE_ENABLE_FTS2", | 31 "SQLITE_ENABLE_FTS2", |
| 32 "SQLITE_ENABLE_FTS3", | 32 "SQLITE_ENABLE_FTS3", |
| 33 "SQLITE_DISABLE_FTS3_UNICODE", |
| 34 "SQLITE_DISABLE_FTS4_DEFERRED", |
| 33 "SQLITE_ENABLE_ICU", | 35 "SQLITE_ENABLE_ICU", |
| 34 "SQLITE_ENABLE_MEMORY_MANAGEMENT", | 36 "SQLITE_ENABLE_MEMORY_MANAGEMENT", |
| 35 "SQLITE_SECURE_DELETE", | 37 "SQLITE_SECURE_DELETE", |
| 36 "SQLITE_SEPARATE_CACHE_POOLS", | 38 "SQLITE_SEPARATE_CACHE_POOLS", |
| 37 "THREADSAFE", | 39 "THREADSAFE", |
| 38 "_HAS_EXCEPTIONS=0", | 40 "_HAS_EXCEPTIONS=0", |
| 39 ] | 41 ] |
| 40 if (is_chromeos) { | 42 if (is_chromeos) { |
| 41 defines += [ | 43 defines += [ |
| 42 # Despite obvious warnings about not using this flag in deployment, we | 44 # Despite obvious warnings about not using this flag in deployment, we |
| 43 # are turning off sync in ChromeOS and relying on the underlying | 45 # are turning off sync in ChromeOS and relying on the underlying |
| 44 # journaling filesystem to do error recovery properly. It's much faster. | 46 # journaling filesystem to do error recovery properly. It's much faster. |
| 45 "SQLITE_NO_SYNC", | 47 "SQLITE_NO_SYNC", |
| 46 ] | 48 ] |
| 47 } | 49 } |
| 50 if (is_posix) { |
| 51 defines += [ |
| 52 # Allow xSleep() call on Unix to use usleep() rather than sleep(), so it |
| 53 # will have microsecond precision. Should only affect contended databases |
| 54 # via the busy callback. Browser profile databases are mostly exclusive, |
| 55 # but renderer databases may allow for contention. |
| 56 "HAVE_USLEEP=1", |
| 57 ] |
| 58 } |
| 48 | 59 |
| 49 include_dirs = [ | 60 include_dirs = [ |
| 50 "amalgamation", | 61 "amalgamation", |
| 51 "src/src", # Needed for fts2 to build. | 62 "src/src", # Needed for fts2 to build. |
| 52 ] | 63 ] |
| 53 | 64 |
| 54 configs -= [ "//build/config/compiler:chromium_code" ] | 65 configs -= [ "//build/config/compiler:chromium_code" ] |
| 55 configs += [ "//build/config/compiler:no_chromium_code" ] | 66 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 56 | 67 |
| 57 if (is_win) { | 68 if (is_win) { |
| 58 cflags += [ "/wd4267" ] # Conversion from size_t to "type". | 69 cflags += [ "/wd4267" ] # Conversion from size_t to "type". |
| 59 } else if (is_linux) { | 70 } else if (is_linux) { |
| 60 cflags += [ | 71 cflags += [ |
| 61 # SQLite doesn"t believe in compiler warnings, | 72 # SQLite doesn"t believe in compiler warnings, |
| 62 # preferring testing. | 73 # preferring testing. |
| 63 # http://www.sqlite.org/faq.html#q17 | 74 # http://www.sqlite.org/faq.html#q17 |
| 64 "-Wno-int-to-pointer-cast", | 75 "-Wno-int-to-pointer-cast", |
| 65 "-Wno-pointer-to-int-cast", | 76 "-Wno-pointer-to-int-cast", |
| 66 ] | 77 ] |
| 67 libs = [ "dl" ] | 78 libs = [ "dl" ] |
| 68 } else if (is_mac || is_ios) { | 79 } else if (is_mac || is_ios) { |
| 69 libs = [ "CoreFoundation.framework" ] | 80 libs = [ "CoreFoundation.framework" ] |
| 70 } else if (is_android) { | 81 } else if (is_android) { |
| 71 defines += [ | 82 defines += [ |
| 72 "HAVE_USLEEP=1", | |
| 73 "SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576", | 83 "SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576", |
| 74 "SQLITE_DEFAULT_AUTOVACUUM=1", | 84 "SQLITE_DEFAULT_AUTOVACUUM=1", |
| 75 "SQLITE_TEMP_STORE=3", | 85 "SQLITE_TEMP_STORE=3", |
| 76 "SQLITE_ENABLE_FTS3_BACKWARDS", | 86 "SQLITE_ENABLE_FTS3_BACKWARDS", |
| 77 "DSQLITE_DEFAULT_FILE_FORMAT=4", | 87 "DSQLITE_DEFAULT_FILE_FORMAT=4", |
| 78 ] | 88 ] |
| 79 } | 89 } |
| 80 | 90 |
| 81 if (is_clang) { | |
| 82 cflags += [ | |
| 83 # sqlite does `if (*a++ && *b++);` in a non-buggy way. | |
| 84 "-Wno-empty-body", | |
| 85 | |
| 86 # sqlite has some `unsigned < 0` checks. | |
| 87 "-Wno-tautological-compare", | |
| 88 ] | |
| 89 } | |
| 90 | |
| 91 public_configs = [ ":sqlite_config" ] | 91 public_configs = [ ":sqlite_config" ] |
| 92 | 92 |
| 93 deps = [ | 93 deps = [ |
| 94 "//third_party/icu", | 94 "//third_party/icu", |
| 95 ] | 95 ] |
| 96 } | 96 } |
| 97 | 97 |
| 98 if (is_linux) { | 98 if (is_linux) { |
| 99 executable("sqlite_shell") { | 99 executable("sqlite_shell") { |
| 100 sources = [ | 100 sources = [ |
| (...skipping 14 matching lines...) Expand all Loading... |
| 115 if (is_ios) { | 115 if (is_ios) { |
| 116 source_set("sqlite_regexp") { | 116 source_set("sqlite_regexp") { |
| 117 sources = [ | 117 sources = [ |
| 118 "src/ext/icu/icu.c", | 118 "src/ext/icu/icu.c", |
| 119 ] | 119 ] |
| 120 deps = [ | 120 deps = [ |
| 121 "//third_party/icu", | 121 "//third_party/icu", |
| 122 ] | 122 ] |
| 123 } | 123 } |
| 124 } | 124 } |
| OLD | NEW |