| package { | |
| default_applicable_licenses: ["external_sqlite_android_license"], | |
| } | |
| // Added automatically by a large-scale-change | |
| // See: http://go/android-license-faq | |
| license { | |
| name: "external_sqlite_android_license", | |
| visibility: [":__subpackages__"], | |
| license_kinds: [ | |
| "SPDX-license-identifier-Apache-2.0", | |
| ], | |
| license_text: [ | |
| "NOTICE", | |
| ], | |
| } | |
| soong_config_module_type { | |
| name: "release_package_libsqlite3_android_defaults_config", | |
| module_type: "cc_defaults", | |
| config_namespace: "libsqlite3", | |
| value_variables: ["release_package_libsqlite3"], | |
| properties: [ | |
| "include_dirs", | |
| ], | |
| } | |
| // Construct the correct source and includes for sqlite libraries, | |
| // based on the build flag. | |
| release_package_libsqlite3_android_defaults_config { | |
| name: "libsqlite3_android_defaults", | |
| soong_config_variables: { | |
| release_package_libsqlite3: { | |
| include_dirs: ["external/sqlite/dist/sqlite-autoconf-%s"], | |
| conditions_default: { | |
| include_dirs: ["external/sqlite/dist/sqlite-default"], | |
| }, | |
| }, | |
| }, | |
| host_supported: true, | |
| cflags: [ | |
| "-Wall", | |
| "-Werror", | |
| "-Wno-unused-function", | |
| "-Wno-unused-variable", | |
| // Disable unique internal linkage names since sqlite source file | |
| // locations contains the version code, and the .uniq hash includes | |
| // the source file path. Version updates would cause the whole AutoFDO | |
| // profile to become outdat. | |
| "-fno-unique-internal-linkage-names", | |
| ], | |
| srcs: [ | |
| "PhoneNumberUtils.cpp", | |
| "OldPhoneNumberUtils.cpp", | |
| "sqlite3_android.cpp", | |
| ], | |
| shared_libs: [ | |
| "liblog", | |
| ], | |
| export_include_dirs: ["."], | |
| } | |
| cc_library_static { | |
| name: "libsqlite3_android", | |
| defaults: ["libsqlite3_android_defaults"], | |
| vendor_available: true, | |
| native_bridge_supported: true, | |
| target: { | |
| android: { | |
| cflags: [ | |
| "-DSQLITE_ENABLE_ICU", | |
| "-DSQLITE_DEFAULT_LEGACY_ALTER_TABLE", | |
| ], | |
| shared_libs: [ | |
| "libandroidicu", | |
| ], | |
| }, | |
| host: { | |
| cflags: ["-DSQLITE_ENABLE_ICU"], | |
| shared_libs: [ | |
| "libicui18n", | |
| "libicuuc", | |
| ], | |
| }, | |
| windows: { | |
| enabled: true, | |
| }, | |
| vendor: { | |
| cflags: ["-USQLITE_ENABLE_ICU"], | |
| exclude_shared_libs: ["libandroidicu"], | |
| }, | |
| }, | |
| apex_available: [ | |
| "//apex_available:platform", | |
| "com.android.virt", | |
| ], | |
| } | |
| // This static library is variant of libsqlite3_android built without the ICU | |
| // extension. The library is supposed to be used in environments where the ICU | |
| // extension is not needed and the dependency to ICU (which is as large as 60+ | |
| // MB) is not desirable, like microdroid. | |
| cc_library_static { | |
| name: "libsqlite3_android_noicu", | |
| defaults: ["libsqlite3_android_defaults"], | |
| // Not define SQLITE_ENABLE_ICU | |
| apex_available: [ | |
| "//apex_available:platform", | |
| "com.android.os.statsd", | |
| "test_com.android.os.statsd", | |
| ], | |
| min_sdk_version: "apex_inherit", | |
| } | |
| // The formal test for phone_number_compare() is in DataBaseGeneralTest.java | |
| // (as of 2009-08-02), in which phone_number_compare() is tested via sqlite's custom | |
| // function "PHONE_NUMBER_COMPARE". | |
| cc_test { | |
| host_supported: true, | |
| name: "libsqlite3_phone_number_utils_test", | |
| cflags: [ | |
| "-Wall", | |
| "-Werror", | |
| ], | |
| srcs: [ | |
| "OldPhoneNumberUtils.cpp", | |
| "OldPhoneNumberUtilsTest.cpp", | |
| "PhoneNumberUtils.cpp", | |
| "PhoneNumberUtilsTest.cpp", | |
| ], | |
| } |