diff --git a/BUILD.gn b/BUILD.gn index 3b03c3791046de8e2318c198c969cf877be217e9..d303343f8424ffa202a432744a4ef68468aaf535 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 b733d959f77b1571557362debe2efd21b3b2745b..9d0f67e493a6d17e0924d29318387d0e09cd2806 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 a951b2701958f58356f45d149251243a32d88fc0..1d6c4046ff5033705fdfb3082a29680d89b1b059 100644 --- a/src/shell.c +++ b/src/shell.c @@ -118,12 +118,15 @@ 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; #if SQLITE_USER_AUTHENTICATION # include "sqlite3userauth.h" #endif + + #include #include @@ -25976,6 +25979,8 @@ 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, diff --git a/src/sqlite3.c b/src/sqlite3.c index 2fb86bc7c442c8964d1059f688e05d8465a18d06..6985b68f3547c112e861ac426bb707b11eb36902 100644 --- a/src/sqlite3.c +++ b/src/sqlite3.c @@ -17,6 +17,9 @@ ** language. The code for the "sqlite3" command-line shell is also in a ** separate file. This file contains only code for the core SQLite library. */ +#ifndef SQLITE_EXPORT +#define SQLITE_EXPORT +#endif #define SQLITE_CORE 1 #define SQLITE_AMALGAMATION 1 #ifndef SQLITE_PRIVATE