1package { 2 default_applicable_licenses: ["external_rust_cxx_license"], 3} 4 5// Added automatically by a large-scale-change that took the approach of 6// 'apply every license found to every target'. While this makes sure we respect 7// every license restriction, it may not be entirely correct. 8// 9// e.g. GPL in an MIT project might only apply to the contrib/ directory. 10// 11// Please consider splitting the single license below into multiple licenses, 12// taking care not to lose any license_kind information, and overriding the 13// default license using the 'licenses: [...]' property on targets as needed. 14// 15// For unused files, consider creating a 'fileGroup' with "//visibility:private" 16// to attach the license to, and including a comment whether the files may be 17// used in the current project. 18// 19// large-scale-change included anything that looked like it might be a license 20// text as a license_text. e.g. LICENSE, NOTICE, COPYING etc. 21// 22// Please consider removing redundant or irrelevant files from 'license_text:'. 23// See: http://go/android-license-faq 24license { 25 name: "external_rust_cxx_license", 26 visibility: [":__subpackages__"], 27 license_kinds: [ 28 "SPDX-license-identifier-Apache-2.0", 29 "SPDX-license-identifier-MIT", 30 ], 31 license_text: [ 32 "LICENSE-APACHE", 33 "LICENSE-MIT", 34 ], 35} 36 37rust_library { 38 name: "libcxx", 39 crate_name: "cxx", 40 srcs: ["src/lib.rs"], 41 edition: "2018", 42 rustlibs: [ 43 "libanyhow", 44 "libthiserror", 45 ], 46 proc_macros: [ 47 "libcxxbridge_macro", 48 ], 49 whole_static_libs: [ 50 "libcxxbridge05", 51 ], 52 shared_libs: ["libc++"], 53 host_supported: true, 54 apex_available: [ 55 "//apex_available:platform", 56 "com.android.bluetooth", 57 "com.android.compos", 58 "com.android.virt", 59 ], 60 min_sdk_version: "29", 61} 62 63cc_library_static { 64 host_supported: true, 65 name: "libcxxbridge05", 66 cflags: ["-DRUST_CXX_NO_EXCEPTIONS"], 67 srcs: ["src/cxx.cc"], 68 apex_available: [ 69 "//apex_available:platform", 70 "com.android.bluetooth", 71 "com.android.compos", 72 "com.android.virt", 73 ], 74 min_sdk_version: "29", 75} 76 77cc_library_static { 78 host_supported: true, 79 name: "libcxx-demo-blobstore", 80 srcs: ["demo/src/blobstore.cc"], 81 generated_headers: ["cxx-demo-bridge-header", "cxx-bridge-header"], 82 generated_sources: ["cxx-demo-bridge-code"], 83} 84 85genrule { 86 name: "cxx-bridge-header", 87 tools: ["cxxbridge"], 88 cmd: "$(location cxxbridge) --header > $(out)", 89 out: ["rust/cxx.h"], 90} 91