| 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 291806 (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 'SQLITE_SEPARATE_CACHE_POOLS', | |
| 34 'THREADSAFE', | |
| 35 '_HAS_EXCEPTIONS=0', | |
| 36 ], | |
| 37 }, | |
| 38 # Added by Dart. We do not indent, so diffs with the original are clearer. | |
| 39 'conditions': [[ 'dart_io_support==1', { | |
| 40 'targets': [ | |
| 41 { | |
| 42 'target_name': 'sqlite_dart', # Added by Dart (the _dart postfix) | |
| 43 'toolsets':['host','target'], | |
| 44 'conditions': [ | |
| 45 [ 'chromeos==1' , { | |
| 46 'defines': [ | |
| 47 # Despite obvious warnings about not using this flag | |
| 48 # in deployment, we are turning off sync in ChromeOS | |
| 49 # and relying on the underlying journaling filesystem | |
| 50 # to do error recovery properly. It's much faster. | |
| 51 'SQLITE_NO_SYNC', | |
| 52 ], | |
| 53 }, | |
| 54 ], | |
| 55 ['use_system_sqlite', { | |
| 56 'type': 'none', | |
| 57 'direct_dependent_settings': { | |
| 58 'defines': [ | |
| 59 'USE_SYSTEM_SQLITE', | |
| 60 ], | |
| 61 }, | |
| 62 | |
| 63 'conditions': [ | |
| 64 ['OS == "ios"', { | |
| 65 'dependencies': [ | |
| 66 'sqlite_regexp', | |
| 67 ], | |
| 68 'link_settings': { | |
| 69 'libraries': [ | |
| 70 '$(SDKROOT)/usr/lib/libsqlite3.dylib', | |
| 71 ], | |
| 72 }, | |
| 73 }], | |
| 74 ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android"'
, { | |
| 75 'direct_dependent_settings': { | |
| 76 'cflags': [ | |
| 77 # This next command produces no output but it it will fail | |
| 78 # (and cause GYP to fail) if we don't have a recent enough | |
| 79 # version of sqlite. | |
| 80 '<!@(pkg-config --atleast-version=<(required_sqlite_version) s
qlite3)', | |
| 81 | |
| 82 '<!@(pkg-config --cflags sqlite3)', | |
| 83 ], | |
| 84 }, | |
| 85 'link_settings': { | |
| 86 'ldflags': [ | |
| 87 '<!@(pkg-config --libs-only-L --libs-only-other sqlite3)', | |
| 88 ], | |
| 89 'libraries': [ | |
| 90 '<!@(pkg-config --libs-only-l sqlite3)', | |
| 91 ], | |
| 92 }, | |
| 93 }], | |
| 94 ], | |
| 95 }, { # !use_system_sqlite | |
| 96 'product_name': 'sqlite3', | |
| 97 'type': 'static_library', | |
| 98 # Changed by Dart: '<(sqlite_directory)/' added to all paths. | |
| 99 'sources': [ | |
| 100 '<(sqlite_directory)/amalgamation/sqlite3.h', | |
| 101 '<(sqlite_directory)/amalgamation/sqlite3.c', | |
| 102 # fts2.c currently has a lot of conflicts when added to | |
| 103 # the amalgamation. It is probably not worth fixing that. | |
| 104 '<(sqlite_directory)/src/ext/fts2/fts2.c', | |
| 105 '<(sqlite_directory)/src/ext/fts2/fts2.h', | |
| 106 '<(sqlite_directory)/src/ext/fts2/fts2_hash.c', | |
| 107 '<(sqlite_directory)/src/ext/fts2/fts2_hash.h', | |
| 108 '<(sqlite_directory)/src/ext/fts2/fts2_icu.c', | |
| 109 '<(sqlite_directory)/src/ext/fts2/fts2_porter.c', | |
| 110 '<(sqlite_directory)/src/ext/fts2/fts2_tokenizer.c', | |
| 111 '<(sqlite_directory)/src/ext/fts2/fts2_tokenizer.h', | |
| 112 '<(sqlite_directory)/src/ext/fts2/fts2_tokenizer1.c', | |
| 113 ], | |
| 114 | |
| 115 # TODO(shess): Previously fts1 and rtree files were | |
| 116 # explicitly excluded from the build. Make sure they are | |
| 117 # logically still excluded. | |
| 118 | |
| 119 # TODO(shess): Should all of the sources be listed and then | |
| 120 # excluded? For editing purposes? | |
| 121 | |
| 122 'include_dirs': [ | |
| 123 '<(sqlite_directory)/amalgamation', | |
| 124 # Needed for fts2 to build. | |
| 125 '<(sqlite_directory)/src/src', | |
| 126 ], | |
| 127 'dependencies': [ | |
| 128 # Disabled by Dart. | |
| 129 # '../icu/icu.gyp:icui18n', | |
| 130 # Disabled by Dart. | |
| 131 # '../icu/icu.gyp:icuuc', | |
| 132 ], | |
| 133 'direct_dependent_settings': { | |
| 134 'include_dirs': [ | |
| 135 '<(sqlite_directory)/.', | |
| 136 '<(sqlite_directory)/../..', | |
| 137 ], | |
| 138 }, | |
| 139 'msvs_disabled_warnings': [ | |
| 140 4018, 4244, 4267, | |
| 141 ], | |
| 142 'variables': { | |
| 143 'clang_warning_flags': [ | |
| 144 # sqlite does `if (*a++ && *b++);` in a non-buggy way. | |
| 145 '-Wno-empty-body', | |
| 146 # sqlite has some `unsigned < 0` checks. | |
| 147 '-Wno-tautological-compare', | |
| 148 ], | |
| 149 }, | |
| 150 'conditions': [ | |
| 151 ['OS=="linux"', { | |
| 152 'link_settings': { | |
| 153 'libraries': [ | |
| 154 '-ldl', | |
| 155 ], | |
| 156 }, | |
| 157 }], | |
| 158 ['OS == "mac" or OS == "ios"', { | |
| 159 'link_settings': { | |
| 160 'libraries': [ | |
| 161 '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework
', | |
| 162 ], | |
| 163 }, | |
| 164 }], | |
| 165 ['OS == "android"', { | |
| 166 'defines': [ | |
| 167 'HAVE_USLEEP=1', | |
| 168 'SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576', | |
| 169 'SQLITE_DEFAULT_AUTOVACUUM=1', | |
| 170 'SQLITE_TEMP_STORE=3', | |
| 171 'SQLITE_ENABLE_FTS3_BACKWARDS', | |
| 172 'DSQLITE_DEFAULT_FILE_FORMAT=4', | |
| 173 ], | |
| 174 }], | |
| 175 ['os_posix == 1 and OS != "mac" and OS != "android"', { | |
| 176 'cflags': [ | |
| 177 # SQLite doesn't believe in compiler warnings, | |
| 178 # preferring testing. | |
| 179 # http://www.sqlite.org/faq.html#q17 | |
| 180 '-Wno-int-to-pointer-cast', | |
| 181 '-Wno-pointer-to-int-cast', | |
| 182 ], | |
| 183 }], | |
| 184 ], | |
| 185 }], | |
| 186 ], | |
| 187 }, | |
| 188 ], | |
| 189 'conditions': [ | |
| 190 ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android" and not
use_system_sqlite', { | |
| 191 'targets': [ | |
| 192 { | |
| 193 'target_name': 'sqlite_shell_dart', # Added by Dart (the _dart postfi
x) | |
| 194 'type': 'executable', | |
| 195 'dependencies': [ | |
| 196 # Disabled by Dart. | |
| 197 # '../icu/icu.gyp:icuuc', | |
| 198 'sqlite_dart', # Added by Dart (the _dart postfix) | |
| 199 ], | |
| 200 'sources': [ | |
| 201 '<(sqlite_directory)/src/src/shell.c', | |
| 202 '<(sqlite_directory)/src/src/shell_icu_linux.c', | |
| 203 # Include a dummy c++ file to force linking of libstdc++. | |
| 204 '<(sqlite_directory)/build_as_cpp.cc', | |
| 205 ], | |
| 206 }, | |
| 207 ], | |
| 208 },], | |
| 209 ['OS == "ios"', { | |
| 210 'targets': [ | |
| 211 { | |
| 212 'target_name': 'sqlite_regexp', | |
| 213 'type': 'static_library', | |
| 214 'dependencies': [ | |
| 215 '../icu/icu.gyp:icui18n', | |
| 216 '../icu/icu.gyp:icuuc', | |
| 217 ], | |
| 218 'sources': [ | |
| 219 'src/ext/icu/icu.c', | |
| 220 ], | |
| 221 }, | |
| 222 ], | |
| 223 }], | |
| 224 ], | |
| 225 }]], | |
| 226 } | |
| OLD | NEW |