Chih-Hung Hsieh | 9a627fb | 2020-07-29 20:55:10 -0700 | [diff] [blame] | 1 | // This file is generated by cargo2android.py --device --run --dependencies --test. |
| 2 | |
| 3 | // We renamed the shared_libs dependence from libsqlite3 to libsqlite. |
Matthew Maurer | 5856e85 | 2020-08-10 16:31:06 -0700 | [diff] [blame] | 4 | // srcs has been moved out of _defaults to work around b/163420435 |
Chih-Hung Hsieh | 9a627fb | 2020-07-29 20:55:10 -0700 | [diff] [blame] | 5 | |
| 6 | rust_library { |
| 7 | name: "liblibsqlite3_sys", |
| 8 | host_supported: true, |
| 9 | crate_name: "libsqlite3_sys", |
Matthew Maurer | 5856e85 | 2020-08-10 16:31:06 -0700 | [diff] [blame] | 10 | srcs: [ |
| 11 | "src/lib.rs", |
| 12 | ":libsqlite3_bindgen", |
| 13 | ], |
Chih-Hung Hsieh | 9a627fb | 2020-07-29 20:55:10 -0700 | [diff] [blame] | 14 | edition: "2018", |
Chih-Hung Hsieh | 9a627fb | 2020-07-29 20:55:10 -0700 | [diff] [blame] | 15 | features: [ |
| 16 | "default", |
| 17 | "min_sqlite_version_3_6_8", |
| 18 | "pkg-config", |
| 19 | "vcpkg", |
| 20 | ], |
| 21 | shared_libs: [ |
| 22 | "libsqlite", |
| 23 | ], |
Chih-Hung Hsieh | 9a627fb | 2020-07-29 20:55:10 -0700 | [diff] [blame] | 24 | } |
| 25 | |
| 26 | rust_defaults { |
| 27 | name: "libsqlite3-sys_defaults", |
| 28 | crate_name: "libsqlite3_sys", |
Chih-Hung Hsieh | 9a627fb | 2020-07-29 20:55:10 -0700 | [diff] [blame] | 29 | test_suites: ["general-tests"], |
| 30 | auto_gen_config: true, |
| 31 | edition: "2018", |
| 32 | features: [ |
| 33 | "default", |
| 34 | "min_sqlite_version_3_6_8", |
| 35 | "pkg-config", |
| 36 | "vcpkg", |
| 37 | ], |
| 38 | shared_libs: [ |
| 39 | "libsqlite", |
| 40 | ], |
Chih-Hung Hsieh | 9a627fb | 2020-07-29 20:55:10 -0700 | [diff] [blame] | 41 | } |
| 42 | |
| 43 | rust_test_host { |
| 44 | name: "libsqlite3-sys_host_test_src_lib", |
Matthew Maurer | 5856e85 | 2020-08-10 16:31:06 -0700 | [diff] [blame] | 45 | srcs: [ |
| 46 | "src/lib.rs", |
| 47 | ":libsqlite3_bindgen", |
| 48 | ], |
Chih-Hung Hsieh | 9a627fb | 2020-07-29 20:55:10 -0700 | [diff] [blame] | 49 | defaults: ["libsqlite3-sys_defaults"], |
| 50 | } |
| 51 | |
| 52 | rust_test { |
| 53 | name: "libsqlite3-sys_device_test_src_lib", |
Matthew Maurer | 5856e85 | 2020-08-10 16:31:06 -0700 | [diff] [blame] | 54 | srcs: [ |
| 55 | "src/lib.rs", |
| 56 | ":libsqlite3_bindgen", |
| 57 | ], |
Chih-Hung Hsieh | 9a627fb | 2020-07-29 20:55:10 -0700 | [diff] [blame] | 58 | defaults: ["libsqlite3-sys_defaults"], |
| 59 | } |
| 60 | |
| 61 | // dependent_library ["feature_list"] |
| 62 | // pkg-config-0.3.18 |
| 63 | |
Matthew Maurer | 5856e85 | 2020-08-10 16:31:06 -0700 | [diff] [blame] | 64 | // Keep this array in sync with the cflags used in external/sqlite |
| 65 | // After b/163598610 is resolved, use defaults instead. |
| 66 | sqlite3_bindgen_clang_flags = [ |
| 67 | " -DNDEBUG=1", |
| 68 | " -DHAVE_USLEEP=1", |
| 69 | " -DSQLITE_HAVE_ISNAN", |
| 70 | " -DSQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576", |
| 71 | " -DSQLITE_THREADSAFE=2", |
| 72 | " -DSQLITE_TEMP_STORE=3", |
| 73 | " -DSQLITE_POWERSAFE_OVERWRITE=1", |
| 74 | " -DSQLITE_DEFAULT_FILE_FORMAT=4", |
| 75 | " -DSQLITE_DEFAULT_AUTOVACUUM=1", |
| 76 | " -DSQLITE_ENABLE_MEMORY_MANAGEMENT=1", |
| 77 | " -DSQLITE_ENABLE_FTS3", |
| 78 | " -DSQLITE_ENABLE_FTS3_BACKWARDS", |
| 79 | " -DSQLITE_ENABLE_FTS4", |
| 80 | " -DSQLITE_OMIT_BUILTIN_TEST", |
| 81 | " -DSQLITE_OMIT_COMPILEOPTION_DIAGS", |
| 82 | " -DSQLITE_OMIT_LOAD_EXTENSION", |
| 83 | " -DSQLITE_DEFAULT_FILE_PERMISSIONS=0600", |
| 84 | " -DSQLITE_SECURE_DELETE", |
| 85 | " -DSQLITE_ENABLE_BATCH_ATOMIC_WRITE", |
| 86 | " -DBIONIC_IOCTL_NO_SIGNEDNESS_OVERLOAD", |
| 87 | " -DHAVE_POSIX_FALLOCATE=1", |
Chih-Hung Hsieh | 9a627fb | 2020-07-29 20:55:10 -0700 | [diff] [blame] | 88 | // extra -D flags for android targets |
Matthew Maurer | 5856e85 | 2020-08-10 16:31:06 -0700 | [diff] [blame] | 89 | " -DUSE_PREAD64", |
| 90 | " -Dfdatasync=fdatasync", |
| 91 | " -DHAVE_MALLOC_H=1", |
| 92 | " -DHAVE_MALLOC_USABLE_SIZE", |
| 93 | " -Wno-unused-parameter", |
| 94 | ] |
Chih-Hung Hsieh | 9a627fb | 2020-07-29 20:55:10 -0700 | [diff] [blame] | 95 | |
Matthew Maurer | 5856e85 | 2020-08-10 16:31:06 -0700 | [diff] [blame] | 96 | rust_bindgen { |
| 97 | name: "libsqlite3_bindgen", |
| 98 | host_supported: true, |
| 99 | crate_name: "sqlite3_bindgen", |
| 100 | custom_bindgen: "sqlite3_bindgen_build", |
| 101 | wrapper_src: "wrapper.h", |
| 102 | source_stem: "bindgen", |
| 103 | cflags: ["-I external/sqlite/dist"] + sqlite3_bindgen_clang_flags, |
Chih-Hung Hsieh | 9a627fb | 2020-07-29 20:55:10 -0700 | [diff] [blame] | 104 | } |