blob: 3005f043a931d995908b5e1fa76f76c789a48d01 [file] [log] [blame]
Bob Badour28353e52021-02-12 15:50:40 -08001package {
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
Matthew Maurer5a12fc82020-06-10 13:58:55 -070037rust_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 static_libs: [
Zach Johnson0d15d492020-11-30 09:21:42 -080050 "libcxxbridge05",
Matthew Maurer5a12fc82020-06-10 13:58:55 -070051 ],
52 shared_libs: ["libc++"],
Zach Johnsonc95654c2020-11-18 12:51:57 -080053 host_supported: true,
Matthew Maurer5a12fc82020-06-10 13:58:55 -070054}
55
56cc_library_static {
57 host_supported: true,
Zach Johnson0d15d492020-11-30 09:21:42 -080058 name: "libcxxbridge05",
Matthew Maurer5a12fc82020-06-10 13:58:55 -070059 cflags: ["-DRUST_CXX_NO_EXCEPTIONS"],
Zach Johnson0d15d492020-11-30 09:21:42 -080060 srcs: ["src/cxx.cc"],
61 apex_available: [
62 "//apex_available:platform",
63 "com.android.bluetooth.updatable",
64 ],
Matthew Maurer5a12fc82020-06-10 13:58:55 -070065}
66
67cc_library_static {
68 host_supported: true,
Matthew Maurer03f51602020-11-23 22:27:59 +000069 name: "libcxx-demo-blobstore",
70 srcs: ["demo/src/blobstore.cc"],
Matthew Maurer5a12fc82020-06-10 13:58:55 -070071 generated_headers: ["cxx-demo-bridge-header", "cxx-bridge-header"],
72 generated_sources: ["cxx-demo-bridge-code"],
73}
74
75genrule {
76 name: "cxx-bridge-header",
77 tools: ["cxxbridge"],
78 cmd: "$(location cxxbridge) --header > $(out)",
79 out: ["rust/cxx.h"],
80}