diff options
-rw-r--r-- | build/common.gypi | 8 | ||||
-rw-r--r-- | sql/sql.gyp | 5 | ||||
-rw-r--r-- | sql/sqlite_features_unittest.cc | 5 | ||||
-rw-r--r-- | third_party/sqlite/sqlite.gyp | 37 |
4 files changed, 37 insertions, 18 deletions
diff --git a/build/common.gypi b/build/common.gypi index 7701e2d..163abae 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -796,6 +796,7 @@ 'enable_managed_users%': 0, 'enable_task_manager%': 0, 'use_system_libcxx%': 1, + 'support_pre_M6_history_database%': 0, }], # Use GPU accelerated cross process image transport by default @@ -1037,6 +1038,9 @@ 'google_default_client_secret%': '', # Native Client is enabled by default. 'disable_nacl%': '0', + + # Set to 1 to support old history files + 'support_pre_M6_history_database%': '1', }, # Copy conditionally-set variables out one scope. @@ -1177,6 +1181,7 @@ 'gomadir%': '<(gomadir)', 'video_hole%': '<(video_hole)', 'enable_load_completion_hacks%': '<(enable_load_completion_hacks)', + 'support_pre_M6_history_database%': '<(support_pre_M6_history_database)', # Whether or not we are building the Athena shell. 'use_athena%': '0', @@ -2305,6 +2310,9 @@ }], ], + # older history files use fts2 instead of fts3 + 'sqlite_enable_fts2%': '<(support_pre_M6_history_database)', + # The path to the ANGLE library. 'angle_path': '<(DEPTH)/third_party/angle', diff --git a/sql/sql.gyp b/sql/sql.gyp index 5926836..4642457 100644 --- a/sql/sql.gyp +++ b/sql/sql.gyp @@ -115,6 +115,11 @@ '../testing/android/native_test.gyp:native_test_native_code', ], }], + ['sqlite_enable_fts2', { + 'defines': [ + 'SQLITE_ENABLE_FTS2', + ], + }], ], # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. 'msvs_disabled_warnings': [4267, ], diff --git a/sql/sqlite_features_unittest.cc b/sql/sqlite_features_unittest.cc index 101e038..e721693 100644 --- a/sql/sqlite_features_unittest.cc +++ b/sql/sqlite_features_unittest.cc @@ -63,10 +63,9 @@ TEST_F(SQLiteFeaturesTest, NoFTS1) { "CREATE VIRTUAL TABLE foo USING fts1(x)")); } -#if !defined(OS_IOS) +#if defined(SQLITE_ENABLE_FTS2) // fts2 is used for older history files, so we're signed on for keeping our -// version up-to-date. iOS does not include fts2, so this test does not run on -// iOS. +// version up-to-date. // TODO(shess): Think up a crazy way to get out from having to support // this forever. TEST_F(SQLiteFeaturesTest, FTS2) { diff --git a/third_party/sqlite/sqlite.gyp b/third_party/sqlite/sqlite.gyp index 6be9f53..2f80fc6 100644 --- a/third_party/sqlite/sqlite.gyp +++ b/third_party/sqlite/sqlite.gyp @@ -10,8 +10,6 @@ 'target_defaults': { 'defines': [ 'SQLITE_CORE', - 'SQLITE_ENABLE_BROKEN_FTS2', - 'SQLITE_ENABLE_FTS2', 'SQLITE_ENABLE_FTS3', 'SQLITE_ENABLE_ICU', 'SQLITE_ENABLE_MEMORY_MANAGEMENT', @@ -81,17 +79,6 @@ 'sources': [ 'amalgamation/sqlite3.h', 'amalgamation/sqlite3.c', - # fts2.c currently has a lot of conflicts when added to - # the amalgamation. It is probably not worth fixing that. - 'src/ext/fts2/fts2.c', - 'src/ext/fts2/fts2.h', - 'src/ext/fts2/fts2_hash.c', - 'src/ext/fts2/fts2_hash.h', - 'src/ext/fts2/fts2_icu.c', - 'src/ext/fts2/fts2_porter.c', - 'src/ext/fts2/fts2_tokenizer.c', - 'src/ext/fts2/fts2_tokenizer.h', - 'src/ext/fts2/fts2_tokenizer1.c', ], # TODO(shess): Previously fts1 and rtree files were @@ -103,8 +90,6 @@ 'include_dirs': [ 'amalgamation', - # Needed for fts2 to build. - 'src/src', ], 'dependencies': [ '../icu/icu.gyp:icui18n', @@ -167,6 +152,28 @@ 'LOCAL_FDO_SUPPORT': 'true', }, }], + ['sqlite_enable_fts2', { + 'defines': [ + 'SQLITE_ENABLE_BROKEN_FTS2', + 'SQLITE_ENABLE_FTS2', + ], + 'sources': [ + # fts2.c currently has a lot of conflicts when added to + # the amalgamation. It is probably not worth fixing that. + 'src/ext/fts2/fts2.c', + 'src/ext/fts2/fts2.h', + 'src/ext/fts2/fts2_hash.c', + 'src/ext/fts2/fts2_hash.h', + 'src/ext/fts2/fts2_icu.c', + 'src/ext/fts2/fts2_porter.c', + 'src/ext/fts2/fts2_tokenizer.c', + 'src/ext/fts2/fts2_tokenizer.h', + 'src/ext/fts2/fts2_tokenizer1.c', + ], + 'include_dirs': [ + 'src/src', + ], + }], ], }], ], |