// // // Build the library // // package { default_applicable_licenses: ["external_sqlite_dist_license"], } // Added automatically by a large-scale-change that took the approach of // 'apply every license found to every target'. While this makes sure we respect // every license restriction, it may not be entirely correct. // // e.g. GPL in an MIT project might only apply to the contrib/ directory. // // Please consider splitting the single license below into multiple licenses, // taking care not to lose any license_kind information, and overriding the // default license using the 'licenses: [...]' property on targets as needed. // // For unused files, consider creating a 'fileGroup' with "//visibility:private" // to attach the license to, and including a comment whether the files may be // used in the current project. // See: http://go/android-license-faq license { name: "external_sqlite_dist_license", visibility: [":__subpackages__"], license_kinds: [ "legacy_permissive", "legacy_unencumbered", ], license_text: [ "NOTICE", ], } cc_defaults { name: "sqlite-minimal-defaults", host_supported: true, // static analysis is too slow on these huge files. tidy_checks: [ "-clang-analyzer-*", ], // NOTE the following flags, // SQLITE_TEMP_STORE=3 causes all TEMP files to go into RAM. and thats the behavior we want // SQLITE_ENABLE_FTS3 enables usage of FTS3 - NOT FTS1 or 2. // SQLITE_DEFAULT_AUTOVACUUM=1 causes the databases to be subject to auto-vacuum cflags: [ "-DNDEBUG=1", "-DHAVE_USLEEP=1", "-DSQLITE_HAVE_ISNAN", "-DSQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576", "-DSQLITE_THREADSAFE=2", "-DSQLITE_TEMP_STORE=3", "-DSQLITE_POWERSAFE_OVERWRITE=1", "-DSQLITE_DEFAULT_FILE_FORMAT=4", "-DSQLITE_DEFAULT_AUTOVACUUM=1", "-DSQLITE_ENABLE_MEMORY_MANAGEMENT=1", "-DSQLITE_ENABLE_FTS3", "-DSQLITE_ENABLE_FTS3_BACKWARDS", "-DSQLITE_ENABLE_FTS4", "-DSQLITE_OMIT_BUILTIN_TEST", "-DSQLITE_OMIT_COMPILEOPTION_DIAGS", "-DSQLITE_OMIT_LOAD_EXTENSION", "-DSQLITE_DEFAULT_FILE_PERMISSIONS=0600", "-DSQLITE_SECURE_DELETE", "-DSQLITE_ENABLE_BATCH_ATOMIC_WRITE", "-DBIONIC_IOCTL_NO_SIGNEDNESS_OVERLOAD", "-DSQLITE_DEFAULT_LEGACY_ALTER_TABLE", "-Wno-unused-parameter", "-Werror", // Default value causes sqlite3_open_v2 to return error if DB is missing. "-ftrivial-auto-var-init=pattern", ], target: { linux_glibc: { cflags: ["-DHAVE_POSIX_FALLOCATE=1"], }, }, } cc_defaults { name: "sqlite-defaults", defaults: ["sqlite-minimal-defaults"], target: { android: { cflags: [ "-DUSE_PREAD64", "-Dfdatasync=fdatasync", "-DHAVE_MALLOC_H=1", "-DHAVE_MALLOC_USABLE_SIZE", "-DSQLITE_ENABLE_DBSTAT_VTAB", ], }, }, } cc_library { name: "libsqlite", defaults: ["sqlite-defaults"], vendor_available: true, native_bridge_supported: true, vndk: { enabled: true, }, srcs: ["sqlite3.c"], target: { android: { shared_libs: [ "libdl", "liblog", "libandroidicu", ], cflags: ["-DSQLITE_ENABLE_ICU"], // include android specific methods whole_static_libs: ["libsqlite3_android"], }, host: { static_libs: [ "liblog", ], }, not_windows: { shared_libs: [ "libicui18n", "libicuuc", ], // include android specific methods whole_static_libs: ["libsqlite3_android"], }, windows: { enabled: true, }, vendor: { cflags: ["-USQLITE_ENABLE_ICU"], exclude_shared_libs: ["libandroidicu"], exclude_static_libs: ["libsqlite3_android"], }, }, export_include_dirs: ["."], } // // // Build the device command line tool sqlite3 // // cc_binary { name: "sqlite3", defaults: ["sqlite-defaults"], srcs: ["shell.c"], target: { android: { shared_libs: [ "libsqlite", "libandroidicu", "liblog", "libutils", ], }, host: { cflags: ["-DNO_ANDROID_FUNCS=1"], static_libs: [ "libsqlite", // sqlite3MemsysAlarm uses LOG() "liblog", ], }, windows: { enabled: true, }, }, } // Build a minimal version of sqlite3 without any android specific // features against the NDK. This is used by libcore's JDBC related // unit tests. cc_library_static { name: "libsqlite_static_minimal", defaults: ["sqlite-minimal-defaults"], srcs: ["sqlite3.c"], sdk_version: "23", export_include_dirs: ["."], }