• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// This file is generated by cargo2android.py --config cargo2android.json.
2// Do not modify this file as changes will be overridden on upgrade.
3
4package {
5    default_applicable_licenses: ["external_rust_crates_quiche_license"],
6}
7
8// Added automatically by a large-scale-change that took the approach of
9// 'apply every license found to every target'. While this makes sure we respect
10// every license restriction, it may not be entirely correct.
11//
12// e.g. GPL in an MIT project might only apply to the contrib/ directory.
13//
14// Please consider splitting the single license below into multiple licenses,
15// taking care not to lose any license_kind information, and overriding the
16// default license using the 'licenses: [...]' property on targets as needed.
17//
18// For unused files, consider creating a 'fileGroup' with "//visibility:private"
19// to attach the license to, and including a comment whether the files may be
20// used in the current project.
21// See: http://go/android-license-faq
22license {
23    name: "external_rust_crates_quiche_license",
24    visibility: [":__subpackages__"],
25    license_kinds: [
26        "SPDX-license-identifier-BSD",
27        "SPDX-license-identifier-ISC",
28        "SPDX-license-identifier-OpenSSL",
29        "legacy_unencumbered",
30    ],
31    license_text: [
32        "COPYING",
33    ],
34}
35
36cc_library_headers {
37    name: "libquiche_ffi_headers",
38    export_include_dirs: ["include"],
39    apex_available: [
40        "//apex_available:platform",
41        "com.android.resolv",
42    ],
43    min_sdk_version: "29",
44}
45
46rust_defaults {
47    name: "libquiche_defaults",
48    stem: "libquiche",
49    host_supported: true,
50    crate_name: "quiche",
51    cargo_env_compat: true,
52    srcs: ["src/lib.rs"],
53    edition: "2018",
54    features: [
55        "boringssl",
56        "default",
57    ],
58    // Link all crates statically to create a self-contained .so library.
59    rlibs: [
60        "liblazy_static",
61        "liblibc",
62        "liblibm",
63        "liblog_rust",
64        "liboctets",
65        "libring",
66        "libslab",
67        "libsmallvec",
68    ],
69    prefer_rlib: true,
70    // For DnsResolver (Mainline module introduced in Q).
71    apex_available: [
72        "//apex_available:platform",
73        "com.android.resolv",
74    ],
75    min_sdk_version: "29",
76}
77
78rust_ffi {
79    name: "libquiche_ffi",
80    defaults: ["libquiche_defaults"],
81    shared_libs: [
82        "libcrypto",
83        "libssl",
84    ],
85    apex_available: [
86        "//apex_available:platform",
87        "com.android.resolv",
88    ],
89    min_sdk_version: "29",
90}
91
92rust_library {
93    name: "libquiche",
94    defaults: ["libquiche_defaults"],
95    shared_libs: [
96        "libcrypto",
97        "libssl",
98    ],
99}
100
101// This target is used by doh_unit_test to prevent compatibility issues
102// because doh_unit_test needs to be run on the R platform.
103rust_library_rlib {
104    name: "libquiche_static",
105    defaults: ["libquiche_defaults"],
106    static_libs: [
107        "libcrypto_static",
108        "libssl",
109    ],
110    apex_available: [
111        "//apex_available:platform",
112        "com.android.resolv",
113    ],
114    min_sdk_version: "29",
115}
116
117rust_defaults {
118    name: "quiche_test_defaults",
119    crate_name: "quiche",
120    cargo_env_compat: true,
121    srcs: ["src/lib.rs"],
122    test_suites: ["general-tests"],
123    auto_gen_config: true,
124    edition: "2018",
125    features: [
126        "boringssl-vendored",
127        "default",
128    ],
129    rustlibs: [
130        "liblazy_static",
131        "liblibc",
132        "liblibm",
133        "liblog_rust",
134        "libmio",
135        "liboctets",
136        "libring",
137        "libslab",
138        "libsmallvec",
139        "liburl",
140    ],
141    data: [
142        "examples/cert.crt",
143        "examples/cert.key",
144        "examples/cert-big.crt",
145        "examples/rootca.crt",
146    ],
147}
148
149rust_test_host {
150    name: "quiche_host_test_src_lib",
151    defaults: ["quiche_test_defaults"],
152    test_options: {
153        unit_test: true,
154    },
155    shared_libs: [
156        "libcrypto",
157        "libssl",
158    ],
159}
160
161rust_test {
162    name: "quiche_device_test_src_lib",
163    defaults: ["quiche_test_defaults"],
164    // To run this test in R platform, it's required to statically link
165    // libcrypto and libssl.
166    static_libs: [
167        "libcrypto_static",
168        "libssl",
169    ],
170}
171