| package { |
| default_visibility: ["//visibility:private"], |
| } |
| |
| rust_protobuf_host { |
| name: "libninja_frontend_protos", |
| crate_name: "ninja_frontend_protos", |
| protos: ["src/frontend.proto"], |
| source_stem: "frontend", |
| } |
| |
| rust_library_host { |
| name: "libn2", |
| crate_name: "n2", |
| srcs: ["src/lib.rs"], |
| edition: "2018", |
| cargo_env_compat: true, |
| lints: "android", |
| // n2 prints the value of CARGO_PKG_VERSION when using the --version argument, we need to set |
| // this property to define the environment variable, but don't actually care about the value. |
| cargo_pkg_version: "android", |
| features: ["built_with_soong"], |
| rustlibs: [ |
| "libanyhow", |
| "libargh", |
| "libdashmap", |
| "liblibc", |
| "liblog_rust", |
| "librayon", |
| "librustc_hash", |
| "libninja_frontend_protos", |
| "libprotobuf", |
| ], |
| target: { |
| linux: { |
| rustlibs: [ |
| "libtikv_jemallocator", |
| ], |
| }, |
| }, |
| } |
| |
| rust_binary_host { |
| name: "n2", |
| crate_name: "n2", |
| srcs: ["src/main.rs"], |
| edition: "2018", |
| lints: "android", |
| rustlibs: [ |
| "libn2", |
| "libanyhow", |
| "libargh", |
| "libenv_logger", |
| "liblibc", |
| "liblog_rust", |
| "librustc_hash", |
| ], |
| sanitize: { |
| // It appears a sanitizer is now enabled by default that causes |
| // n2 to fail with errors about memory leaks. We need to debug this, |
| // but it may just be caused by our intentional use of std::mem::forget |
| never: true, |
| }, |
| } |
| |
| rust_test_host { |
| name: "n2_unit_tests", |
| srcs: ["src/lib.rs"], |
| edition: "2018", |
| lints: "android", |
| cargo_env_compat: true, |
| // n2 prints the value of CARGO_PKG_VERSION when using the --version argument, we need to set |
| // this property to define the environment variable, but don't actually care about the value. |
| cargo_pkg_version: "android", |
| features: ["built_with_soong"], |
| rustlibs: [ |
| "libtempfile", |
| "libanyhow", |
| "libargh", |
| "libdashmap", |
| "liblibc", |
| "liblog_rust", |
| "librayon", |
| "librustc_hash", |
| "libninja_frontend_protos", |
| "libprotobuf", |
| ], |
| target: { |
| linux: { |
| rustlibs: [ |
| "libtikv_jemallocator", |
| ], |
| }, |
| }, |
| } |
| |
| rust_test_host { |
| name: "n2_e2e_tests", |
| srcs: ["tests/e2e_test.rs"], |
| edition: "2018", |
| lints: "android", |
| rustlibs: [ |
| "libtempfile", |
| "libanyhow", |
| ], |
| } |