Victor Hsieh | 1fe51c4 | 2020-11-05 11:08:10 -0800 | [diff] [blame] | 1 | rust_defaults { |
| 2 | name: "authfs_defaults", |
| 3 | crate_name: "authfs", |
| 4 | srcs: [ |
Victor Hsieh | 88ac6ca | 2020-11-13 15:20:24 -0800 | [diff] [blame^] | 5 | "src/main.rs", |
Victor Hsieh | 1fe51c4 | 2020-11-05 11:08:10 -0800 | [diff] [blame] | 6 | ], |
| 7 | edition: "2018", |
| 8 | rustlibs: [ |
Victor Hsieh | ec18456 | 2020-11-06 13:50:31 -0800 | [diff] [blame] | 9 | "libanyhow", |
Victor Hsieh | d1cb0d7 | 2020-11-06 13:49:55 -0800 | [diff] [blame] | 10 | "libauthfs_crypto_bindgen", |
Victor Hsieh | 88ac6ca | 2020-11-13 15:20:24 -0800 | [diff] [blame^] | 11 | "libcfg_if", |
| 12 | "libfuse_rust", |
Victor Hsieh | 1fe51c4 | 2020-11-05 11:08:10 -0800 | [diff] [blame] | 13 | "liblibc", |
Victor Hsieh | 88ac6ca | 2020-11-13 15:20:24 -0800 | [diff] [blame^] | 14 | "libstructopt", |
Victor Hsieh | d1cb0d7 | 2020-11-06 13:49:55 -0800 | [diff] [blame] | 15 | "libthiserror", |
Victor Hsieh | 1fe51c4 | 2020-11-05 11:08:10 -0800 | [diff] [blame] | 16 | ], |
| 17 | host_supported: true, |
Victor Hsieh | d1cb0d7 | 2020-11-06 13:49:55 -0800 | [diff] [blame] | 18 | shared_libs: ["libcrypto"], |
Victor Hsieh | 1fe51c4 | 2020-11-05 11:08:10 -0800 | [diff] [blame] | 19 | clippy_lints: "android", |
Victor Hsieh | 88ac6ca | 2020-11-13 15:20:24 -0800 | [diff] [blame^] | 20 | |
| 21 | // libfuse_rust currently has only the 64-bit variant (or more broadly speaking, the whole |
| 22 | // crosvm projects). Limit the build to 64 bits since we won't need 32 bits anyway. |
| 23 | compile_multilib: "64", |
Victor Hsieh | 1fe51c4 | 2020-11-05 11:08:10 -0800 | [diff] [blame] | 24 | } |
| 25 | |
Victor Hsieh | d1cb0d7 | 2020-11-06 13:49:55 -0800 | [diff] [blame] | 26 | // TODO(b/172687320): remove once there is a canonical bindgen. |
| 27 | rust_bindgen { |
| 28 | name: "libauthfs_crypto_bindgen", |
| 29 | wrapper_src: "src/crypto.hpp", |
| 30 | crate_name: "authfs_crypto_bindgen", |
| 31 | source_stem: "bindings", |
| 32 | shared_libs: [ |
| 33 | "libcrypto", |
| 34 | ], |
| 35 | bindgen_flags: ["--size_t-is-usize"], |
| 36 | cflags: ["-D BORINGSSL_NO_CXX"], |
| 37 | host_supported: true, |
| 38 | } |
| 39 | |
Victor Hsieh | 88ac6ca | 2020-11-13 15:20:24 -0800 | [diff] [blame^] | 40 | rust_binary { |
| 41 | name: "authfs", |
Victor Hsieh | 1fe51c4 | 2020-11-05 11:08:10 -0800 | [diff] [blame] | 42 | defaults: ["authfs_defaults"], |
| 43 | } |
| 44 | |
| 45 | rust_test_host { |
| 46 | name: "authfs_host_test_src_lib", |
| 47 | test_suites: ["general-tests"], |
| 48 | defaults: ["authfs_defaults"], |
| 49 | } |
| 50 | |
| 51 | // TODO(victorhsieh): Enable the test once "undefined symbol: _Unwind_Resume" is fixed, then add to |
| 52 | // TEST_MAPPING. |
| 53 | //rust_test { |
| 54 | // name: "authfs_device_test_src_lib", |
| 55 | // defaults: ["authfs_defaults"], |
| 56 | //} |