• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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}
55
56cc_library_static {
57    host_supported: true,
58    name: "libcxxbridge05",
59    cflags: ["-DRUST_CXX_NO_EXCEPTIONS"],
60    srcs: ["src/cxx.cc"],
61    apex_available: [
62        "//apex_available:platform",
63        "com.android.bluetooth.updatable",
64    ],
65}
66
67cc_library_static {
68    host_supported: true,
69    name: "libcxx-demo-blobstore",
70    srcs: ["demo/src/blobstore.cc"],
71    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}
81