diff --git a/BUILD.gn b/BUILD.gn index 3b03c3791046de8e2318c198c969cf877be217e9..59b27549595e8600c16774dc8f74fc49d6115747 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -112,6 +112,7 @@ ohos_shared_library("sqlite") { "SQLITE_DIRECT_OVERFLOW_READ", "SQLITE_HAS_CODEC", "SQLITE_EXPORT_SYMBOLS", + "SQLITE_API=SQLITE_EXPORT", "SQLITE_SHARED_BLOCK_OPTIMIZATION", "SQLITE_CODEC_ATTACH_CHANGED", "SQLITE_ENABLE_DROPTABLE_CALLBACK", @@ -158,10 +159,7 @@ ohos_shared_library("sqlite") { ohos_executable("sqlite3") { include_dirs = [ "$sqlite_patched_dir/include" ] - sources = [ - "$sqlite_patched_dir/src/shell.c", - "$sqlite_patched_dir/src/sqlite3.c", - ] + sources = ["$sqlite_patched_dir/src/shell.c"] defines = [ "NDEBUG=1", @@ -192,10 +190,20 @@ ohos_executable("sqlite3") { cflags = [ "-Wno-error=implicit-function-declaration", + "-Wno-macro-redefined", "-Wno-implicit-fallthrough", ] - deps = [ "//third_party/sqlite/patch:apply_patch" ] + deps = [ + ":sqlite", + "//third_party/sqlite/patch:apply_patch", + ] + + public_configs = [ ":sqlite_config" ] + external_deps = [ "c_utils:utils" ] + configs = [ ":sqlite3_private_config" ] + part_name = "sqlite" + subsystem_name = "thirdparty" } if (is_mingw || is_mac) { diff --git a/bundle.json b/bundle.json index cc2fc2757e405992d5bf437d8d9b836ffe9d3f86..12ce2cead8f6a87a213cb6a6e99841f26e77b079 100644 --- a/bundle.json +++ b/bundle.json @@ -31,6 +31,7 @@ "build": { "sub_component": [ "//third_party/sqlite:sqlite", + "//third_party/sqlite:sqlite3", "//third_party/sqlite:sqliteicu" ], "inner_kits": [ @@ -46,6 +47,9 @@ }, { "name": "//third_party/sqlite:sqliteicu" + }, + { + "name": "//third_party/sqlite:sqlite3" } ], "test": [] diff --git a/src/shell.c b/src/shell.c index b08671e14de3682ddfc689af355a00878e4e4110..8e4cf20ac64b423fa32337ad7211afcfda219603 100644 --- a/src/shell.c +++ b/src/shell.c @@ -119,6 +119,7 @@ typedef unsigned short int u16; #include #include #include "sqlite3.h" +#include "sqlite3sym.h" typedef sqlite3_int64 i64; typedef sqlite3_uint64 u64; typedef unsigned char u8; @@ -30433,7 +30434,9 @@ int SQLITE_CDECL wmain(int argc, wchar_t **wargv){ warnInmemoryDb = 0; } #endif - + // The icu analyzer is enabled by default on the client tool. + sqlite3_config(SQLITE_CONFIG_ENABLE_ICU); + /* Do an initial pass through the command-line argument to locate ** the name of the database file, the name of the initialization file, ** the size of the alternative malloc heap, options affecting commands diff --git a/src/sqlite3.c b/src/sqlite3.c index 946815f13ec88233ffd608e68a1000284d9b517e..8d2ed75290525f79c08b187fd93626bed039a04a 100644 --- a/src/sqlite3.c +++ b/src/sqlite3.c @@ -20,6 +20,9 @@ ** The content in this amalgamation comes from Fossil check-in ** c9c2ab54ba1f5f46360f1b4f35d849cd3f08. */ +#ifndef SQLITE_EXPORT +#define SQLITE_EXPORT +#endif #define SQLITE_CORE 1 #define SQLITE_AMALGAMATION 1 #ifndef SQLITE_PRIVATE