| OLD | NEW |
| (Empty) | |
| 1 # Copyright (c) 2012 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 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 6 # for details. All rights reserved. Use of this source code is governed by a |
| 7 # BSD-style license that can be found in the LICENSE file. |
| 8 |
| 9 # This file is a modified copy of Chromium's src/third_party/sqlite/sqlite.gyp. |
| 10 # Revision 165464 (this should agree with "nss_rev" in DEPS). |
| 11 { |
| 12 # Added by Dart. All Dart comments refer to the following block or line. |
| 13 'includes': [ |
| 14 '../../tools/gyp/runtime-configurations.gypi', |
| 15 '../../tools/gyp/nss_configurations.gypi', |
| 16 ], |
| 17 'variables': { |
| 18 # Added by Dart. |
| 19 'sqlite_directory': '../../../third_party/sqlite', |
| 20 'use_system_sqlite%': 0, |
| 21 'required_sqlite_version': '3.6.1', |
| 22 }, |
| 23 'target_defaults': { |
| 24 'defines': [ |
| 25 'SQLITE_CORE', |
| 26 'SQLITE_ENABLE_BROKEN_FTS2', |
| 27 'SQLITE_ENABLE_FTS2', |
| 28 'SQLITE_ENABLE_FTS3', |
| 29 # Disabled by Dart: An external module with advanced unicode functions. |
| 30 # 'SQLITE_ENABLE_ICU', |
| 31 'SQLITE_ENABLE_MEMORY_MANAGEMENT', |
| 32 'SQLITE_SECURE_DELETE', |
| 33 'THREADSAFE', |
| 34 '_HAS_EXCEPTIONS=0', |
| 35 ], |
| 36 }, |
| 37 'targets': [ |
| 38 { |
| 39 'target_name': 'sqlite', |
| 40 'conditions': [ |
| 41 [ 'chromeos==1' , { |
| 42 'defines': [ |
| 43 # Despite obvious warnings about not using this flag |
| 44 # in deployment, we are turning off sync in ChromeOS |
| 45 # and relying on the underlying journaling filesystem |
| 46 # to do error recovery properly. It's much faster. |
| 47 'SQLITE_NO_SYNC', |
| 48 ], |
| 49 }, |
| 50 ], |
| 51 ['use_system_sqlite', { |
| 52 'type': 'none', |
| 53 'direct_dependent_settings': { |
| 54 'defines': [ |
| 55 'USE_SYSTEM_SQLITE', |
| 56 ], |
| 57 }, |
| 58 |
| 59 'conditions': [ |
| 60 ['OS == "ios"', { |
| 61 'link_settings': { |
| 62 'libraries': [ |
| 63 '$(SDKROOT)/usr/lib/libsqlite3.dylib', |
| 64 ], |
| 65 }, |
| 66 }], |
| 67 ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android"'
, { |
| 68 'direct_dependent_settings': { |
| 69 'cflags': [ |
| 70 # This next command produces no output but it it will fail |
| 71 # (and cause GYP to fail) if we don't have a recent enough |
| 72 # version of sqlite. |
| 73 '<!@(pkg-config --atleast-version=<(required_sqlite_version) s
qlite3)', |
| 74 |
| 75 '<!@(pkg-config --cflags sqlite3)', |
| 76 ], |
| 77 }, |
| 78 'link_settings': { |
| 79 'ldflags': [ |
| 80 '<!@(pkg-config --libs-only-L --libs-only-other sqlite3)', |
| 81 ], |
| 82 'libraries': [ |
| 83 '<!@(pkg-config --libs-only-l sqlite3)', |
| 84 ], |
| 85 }, |
| 86 }], |
| 87 ], |
| 88 }, { # !use_system_sqlite |
| 89 'product_name': 'sqlite3', |
| 90 'type': 'static_library', |
| 91 # Changed by Dart: '<(sqlite_directory)/' added to all paths. |
| 92 'sources': [ |
| 93 '<(sqlite_directory)/amalgamation/sqlite3.h', |
| 94 '<(sqlite_directory)/amalgamation/sqlite3.c', |
| 95 # fts2.c currently has a lot of conflicts when added to |
| 96 # the amalgamation. It is probably not worth fixing that. |
| 97 '<(sqlite_directory)/src/ext/fts2/fts2.c', |
| 98 '<(sqlite_directory)/src/ext/fts2/fts2.h', |
| 99 '<(sqlite_directory)/src/ext/fts2/fts2_hash.c', |
| 100 '<(sqlite_directory)/src/ext/fts2/fts2_hash.h', |
| 101 '<(sqlite_directory)/src/ext/fts2/fts2_icu.c', |
| 102 '<(sqlite_directory)/src/ext/fts2/fts2_porter.c', |
| 103 '<(sqlite_directory)/src/ext/fts2/fts2_tokenizer.c', |
| 104 '<(sqlite_directory)/src/ext/fts2/fts2_tokenizer.h', |
| 105 '<(sqlite_directory)/src/ext/fts2/fts2_tokenizer1.c', |
| 106 ], |
| 107 |
| 108 # TODO(shess): Previously fts1 and rtree files were |
| 109 # explicitly excluded from the build. Make sure they are |
| 110 # logically still excluded. |
| 111 |
| 112 # TODO(shess): Should all of the sources be listed and then |
| 113 # excluded? For editing purposes? |
| 114 |
| 115 'include_dirs': [ |
| 116 '<(sqlite_directory)/amalgamation', |
| 117 # Needed for fts2 to build. |
| 118 '<(sqlite_directory)/src/src', |
| 119 ], |
| 120 'dependencies': [ |
| 121 # Disabled by Dart. |
| 122 # '../icu/icu.gyp:icui18n', |
| 123 # Disabled by Dart. |
| 124 # '../icu/icu.gyp:icuuc', |
| 125 ], |
| 126 'direct_dependent_settings': { |
| 127 'include_dirs': [ |
| 128 '<(sqlite_directory)/.', |
| 129 '<(sqlite_directory)/../..', |
| 130 ], |
| 131 }, |
| 132 'msvs_disabled_warnings': [ |
| 133 4018, 4244, |
| 134 ], |
| 135 'conditions': [ |
| 136 ['OS=="linux"', { |
| 137 'link_settings': { |
| 138 'libraries': [ |
| 139 '-ldl', |
| 140 ], |
| 141 }, |
| 142 }], |
| 143 ['OS == "android"', { |
| 144 'defines': [ |
| 145 'HAVE_USLEEP=1', |
| 146 'SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576', |
| 147 'SQLITE_DEFAULT_AUTOVACUUM=1', |
| 148 'SQLITE_TEMP_STORE=3', |
| 149 'SQLITE_ENABLE_FTS3_BACKWARDS', |
| 150 'DSQLITE_DEFAULT_FILE_FORMAT=4', |
| 151 ], |
| 152 }], |
| 153 ['os_posix == 1 and OS != "mac" and OS != "android"', { |
| 154 'cflags': [ |
| 155 # SQLite doesn't believe in compiler warnings, |
| 156 # preferring testing. |
| 157 # http://www.sqlite.org/faq.html#q17 |
| 158 '-Wno-int-to-pointer-cast', |
| 159 '-Wno-pointer-to-int-cast', |
| 160 ], |
| 161 }], |
| 162 ['clang==1', { |
| 163 'xcode_settings': { |
| 164 'WARNING_CFLAGS': [ |
| 165 # sqlite does `if (*a++ && *b++);` in a non-buggy way. |
| 166 '-Wno-empty-body', |
| 167 # sqlite has some `unsigned < 0` checks. |
| 168 '-Wno-tautological-compare', |
| 169 ], |
| 170 }, |
| 171 'cflags': [ |
| 172 '-Wno-empty-body', |
| 173 '-Wno-tautological-compare', |
| 174 ], |
| 175 }], |
| 176 ], |
| 177 }], |
| 178 ], |
| 179 }, |
| 180 ], |
| 181 'conditions': [ |
| 182 ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android" and not
use_system_sqlite', { |
| 183 'targets': [ |
| 184 { |
| 185 'target_name': 'sqlite_shell_dart', |
| 186 'type': 'executable', |
| 187 'dependencies': [ |
| 188 # Disabled by Dart. |
| 189 # '../icu/icu.gyp:icuuc', |
| 190 'sqlite', |
| 191 ], |
| 192 'sources': [ |
| 193 '<(sqlite_directory)/src/src/shell.c', |
| 194 '<(sqlite_directory)/src/src/shell_icu_linux.c', |
| 195 ], |
| 196 'link_settings': { |
| 197 'link_languages': ['c++'], |
| 198 }, |
| 199 }, |
| 200 ], |
| 201 },] |
| 202 ], |
| 203 } |
| OLD | NEW |