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    srcs: ["src/lib.rs"],
52    edition: "2018",
53    features: [
54        "boringssl",
55        "default",
56    ],
57    // Link all crates statically to create a self-contained .so library.
58    rlibs: [
59        "liblazy_static",
60        "liblibc",
61        "liblibm",
62        "liblog_rust",
63        "libring",
64    ],
65    prefer_rlib: true,
66    // For DnsResolver (Mainline module introduced in Q).
67    apex_available: [
68        "//apex_available:platform",
69        "com.android.resolv",
70    ],
71    min_sdk_version: "29",
72}
73
74rust_ffi {
75    name: "libquiche_ffi",
76    defaults: ["libquiche_defaults"],
77    shared_libs: [
78        "libcrypto",
79        "libssl",
80    ],
81}
82
83rust_library {
84    name: "libquiche",
85    defaults: ["libquiche_defaults"],
86    shared_libs: [
87        "libcrypto",
88        "libssl",
89    ],
90}
91
92// This target is used by doh_unit_test to prevent compatibility issues
93// because doh_unit_test needs to be run on the R platform.
94rust_library_rlib {
95    name: "libquiche_static",
96    defaults: ["libquiche_defaults"],
97    static_libs: [
98        "libcrypto_static",
99        "libssl",
100    ],
101}
102
103rust_defaults {
104    name: "quiche_defaults",
105    crate_name: "quiche",
106    srcs: ["src/lib.rs"],
107    test_suites: ["general-tests"],
108    auto_gen_config: true,
109    edition: "2018",
110    features: [
111        "boringssl",
112        "default",
113    ],
114    rustlibs: [
115        "liblazy_static",
116        "liblibc",
117        "liblibm",
118        "liblog_rust",
119        "libmio",
120        "libring",
121        "liburl",
122    ],
123    data: [
124        "examples/cert.crt",
125        "examples/cert.key",
126        "examples/cert-big.crt",
127        "examples/rootca.crt",
128    ]
129}
130
131rust_test_host {
132    name: "quiche_host_test_src_lib",
133    defaults: ["quiche_defaults"],
134    test_options: {
135        unit_test: true,
136    },
137    shared_libs: [
138        "libcrypto",
139        "libssl",
140    ],
141}
142
143rust_test {
144    name: "quiche_device_test_src_lib",
145    defaults: ["quiche_defaults"],
146    // To run this test in R platform, it's required to statically link
147    // libcrypto and libssl.
148    static_libs: [
149        "libcrypto_static",
150        "libssl",
151    ],
152}
153
154// dependent_library ["feature_list"]
155//   cc-1.0.67
156//   cfg-if-0.1.10
157//   cfg-if-1.0.0
158//   cmake-0.1.45
159//   idna-0.1.5
160//   iovec-0.1.4
161//   lazy_static-1.4.0
162//   libc-0.2.94 "default,std"
163//   libm-0.2.1 "default"
164//   log-0.4.14 "std"
165//   matches-0.1.8
166//   mio-0.6.23 "default,with-deprecated"
167//   net2-0.2.37 "default,duration"
168//   once_cell-1.7.2 "alloc,race,std"
169//   percent-encoding-1.0.1
170//   ring-0.16.20 "alloc,default,dev_urandom_fallback,once_cell"
171//   slab-0.4.3 "default,std"
172//   spin-0.5.2
173//   tinyvec-1.2.0 "alloc,default,tinyvec_macros"
174//   tinyvec_macros-0.1.0
175//   unicode-bidi-0.3.5 "default"
176//   unicode-normalization-0.1.17 "default,std"
177//   untrusted-0.7.1
178//   url-1.7.2
179