Alan Stokes | 14f0739 | 2021-09-27 14:03:31 +0100 | [diff] [blame^] | 1 | package { |
| 2 | default_applicable_licenses: ["Android-Apache-2.0"], |
| 3 | } |
| 4 | |
| 5 | rust_library { |
| 6 | name: "libcomposd_native_rust", |
| 7 | crate_name: "composd_native", |
| 8 | srcs: ["lib.rs"], |
| 9 | rustlibs: [ |
| 10 | "libcxx", |
| 11 | ], |
| 12 | static_libs: [ |
| 13 | "libcomposd_native_cpp", |
| 14 | ], |
| 15 | shared_libs: ["libcrypto"], |
| 16 | apex_available: ["com.android.compos"], |
| 17 | } |
| 18 | |
| 19 | cc_library_static { |
| 20 | name: "libcomposd_native_cpp", |
| 21 | srcs: ["composd_native.cpp"], |
| 22 | shared_libs: ["libcrypto"], |
| 23 | generated_headers: ["composd_native_header"], |
| 24 | generated_sources: ["composd_native_code"], |
| 25 | apex_available: ["com.android.compos"], |
| 26 | } |
| 27 | |
| 28 | genrule { |
| 29 | name: "composd_native_code", |
| 30 | tools: ["cxxbridge"], |
| 31 | cmd: "$(location cxxbridge) $(in) >> $(out)", |
| 32 | srcs: ["lib.rs"], |
| 33 | out: ["composd_native_cxx_generated.cc"], |
| 34 | } |
| 35 | |
| 36 | genrule { |
| 37 | name: "composd_native_header", |
| 38 | tools: ["cxxbridge"], |
| 39 | cmd: "$(location cxxbridge) $(in) --header >> $(out)", |
| 40 | srcs: ["lib.rs"], |
| 41 | out: ["lib.rs.h"], |
| 42 | } |