Alan Stokes | 223a746 | 2022-01-20 14:12:24 +0000 | [diff] [blame] | 1 | package { |
| 2 | default_applicable_licenses: ["Android-Apache-2.0"], |
| 3 | } |
| 4 | |
| 5 | rust_library { |
| 6 | name: "libcompos_native_rust", |
| 7 | crate_name: "compos_native", |
| 8 | srcs: ["lib.rs"], |
| 9 | rustlibs: [ |
| 10 | "libanyhow", |
| 11 | "libcxx", |
| 12 | "liblibc", |
| 13 | ], |
| 14 | static_libs: [ |
| 15 | "libcompos_native_cpp", |
| 16 | ], |
| 17 | shared_libs: [ |
| 18 | "libcrypto", |
| 19 | ], |
| 20 | apex_available: ["com.android.compos"], |
| 21 | } |
| 22 | |
| 23 | cc_library_static { |
| 24 | name: "libcompos_native_cpp", |
| 25 | srcs: ["compos_native.cpp"], |
| 26 | shared_libs: ["libcrypto"], |
| 27 | generated_headers: ["compos_native_header"], |
| 28 | generated_sources: ["compos_native_code"], |
| 29 | apex_available: ["com.android.compos"], |
| 30 | } |
| 31 | |
| 32 | genrule { |
| 33 | name: "compos_native_code", |
| 34 | tools: ["cxxbridge"], |
| 35 | cmd: "$(location cxxbridge) $(in) >> $(out)", |
| 36 | srcs: ["lib.rs"], |
| 37 | out: ["compos_native_cxx_generated.cc"], |
| 38 | } |
| 39 | |
| 40 | genrule { |
| 41 | name: "compos_native_header", |
| 42 | tools: ["cxxbridge"], |
| 43 | cmd: "$(location cxxbridge) $(in) --header >> $(out)", |
| 44 | srcs: ["lib.rs"], |
| 45 | out: ["lib.rs.h"], |
| 46 | } |