blob: c5d129eb639764f00f9d069c6d8bb20827057f61 [file] [log] [blame]
Dan Willemsen6365a872016-09-13 16:29:54 -07001// Copyright (C) 2016 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
Bob Badourad2415c2021-02-12 17:33:30 -080015package {
16 default_applicable_licenses: ["system_libhidl_license"],
17}
18
19// Added automatically by a large-scale-change
20// See: http://go/android-license-faq
21license {
22 name: "system_libhidl_license",
23 visibility: [":__subpackages__"],
24 license_kinds: [
25 "SPDX-license-identifier-Apache-2.0",
26 ],
27 license_text: [
28 "NOTICE",
29 ],
30}
31
Steven Morelandc75fc622017-08-04 11:04:39 -070032cc_defaults {
33 name: "libhidl-defaults",
34 cflags: [
35 "-Wall",
Steven Moreland37814cb2018-10-24 16:28:35 -070036 "-Wdocumentation", // since some users use this
Steven Morelandc75fc622017-08-04 11:04:39 -070037 "-Werror",
Bernhard Rosenkränzer0c28fd22018-06-04 16:01:47 +020038 "-Wextra-semi",
Steven Morelandc75fc622017-08-04 11:04:39 -070039 ],
40}
Steven Moreland8dd65742017-02-17 22:39:46 -080041
Steven Moreland37e8d3a2019-04-26 12:33:21 -070042phony {
43 name: "libhidl",
44 required: [
45 "libhidlbase",
Steven Moreland37e8d3a2019-04-26 12:33:21 -070046 ],
47}
48
Steven Morelande695c3e2019-08-21 15:36:22 -070049cc_library_headers {
Steven Morelandbecd44e2019-10-29 14:20:00 -070050 name: "libhidl_gtest_helper",
Michael Butler93923732022-01-12 13:42:23 -080051 host_supported: true,
Steven Morelandbecd44e2019-10-29 14:20:00 -070052 export_include_dirs: ["gtest_helper"],
Steven Morelande695c3e2019-08-21 15:36:22 -070053}
54
Yifan Hong00f4a392016-11-16 12:35:58 -080055cc_test {
56 name: "libhidl_test",
Steven Moreland2056cf32019-09-17 17:41:02 -070057 host_supported: true,
Steven Morelandc75fc622017-08-04 11:04:39 -070058 defaults: ["libhidl-defaults"],
Yifan Hong00f4a392016-11-16 12:35:58 -080059 gtest: false,
Chih-Hung Hsieh415623f2022-02-17 17:27:15 -080060 tidy_timeout_srcs: ["test_main.cpp"],
Yifan Hong00f4a392016-11-16 12:35:58 -080061 srcs: ["test_main.cpp"],
Steven Moreland17453832019-02-25 12:01:22 -080062 test_suites: ["device-tests"],
Yifan Hong00f4a392016-11-16 12:35:58 -080063
Dan Willemsen6365a872016-09-13 16:29:54 -070064 shared_libs: [
Steven Moreland138c3502018-11-27 14:27:04 -080065 "android.hidl.memory@1.0",
Dan Willemsen6365a872016-09-13 16:29:54 -070066 "libbase",
Steven Moreland348563a2019-06-19 13:53:19 -070067 "libhidlbase",
68 "liblog",
Dan Willemsen6365a872016-09-13 16:29:54 -070069 "libutils",
Jeff Tinker0f3461d2017-01-03 10:40:55 -080070 "libcutils",
Dan Willemsen6365a872016-09-13 16:29:54 -070071 ],
Steven Moreland55d2dcd2020-02-10 17:20:56 -080072 static_libs: [
73 "libgtest",
74 "libgmock",
75 ],
Yifan Hong00f4a392016-11-16 12:35:58 -080076
77 cflags: [
78 "-O0",
79 "-g",
Steven Morelandc75fc622017-08-04 11:04:39 -070080 ],
Dan Willemsen6365a872016-09-13 16:29:54 -070081}
Steven Morelanda46371d2019-06-05 18:29:06 -070082
Steven Moreland9f53eda2019-06-17 17:17:02 -070083cc_library {
84 name: "libhidlbase",
85 defaults: ["libhidlbase-combined-impl"],
Steven Moreland2056cf32019-09-17 17:41:02 -070086 host_supported: true,
Victor Khimenko538af7d2020-07-08 23:24:21 +020087 // TODO(b/153609531): remove when no longer needed.
88 native_bridge_supported: true,
Steven Moreland9f53eda2019-06-17 17:17:02 -070089 recovery_available: true,
90 vendor_available: true,
Justin Yun8ee97132020-11-11 19:23:49 +090091 product_available: true,
Przemyslaw Szczepaniak4f0d1e32020-02-13 20:01:04 +000092 apex_available: [
93 // TODO(b/137948090): not fully supported in APEX for certain usecases
94 // - large dependency sizes
95 // - VINTF manifest cannot be read from APEX
96 // - no testing story/infra for deprecation schedule
97 "//apex_available:platform",
98 "com.android.neuralnetworks",
99 "test_com.android.neuralnetworks",
Etienne Ruffieuxa7085792021-12-15 15:35:59 +0000100 "com.android.bluetooth",
Jiyong Park958a03f2020-03-07 17:23:16 +0900101 "com.android.media",
102 "com.android.media.swcodec",
103 "com.android.tethering",
Przemyslaw Szczepaniak4f0d1e32020-02-13 20:01:04 +0000104 ],
Steven Moreland9f53eda2019-06-17 17:17:02 -0700105 vndk: {
106 enabled: true,
107 support_system_process: true,
108 },
109 whole_static_libs: [
110 "libhwbinder-impl-internal",
111 ],
Jooyung Handfe14f12020-04-16 18:48:34 +0900112 min_sdk_version: "29",
Yi Kong314387e2022-01-12 09:39:19 +0800113 afdo: true,
Steven Moreland9f53eda2019-06-17 17:17:02 -0700114}
115
Steven Morelanda46371d2019-06-05 18:29:06 -0700116// WARNING: deprecated
Steven Morelanda29e20f2020-07-07 23:35:46 +0000117// This library is no longer required, and dependencies should be taken on libhidlbase instead.
118// This is automatically removed by bpfix. Once there are no makefiles, fixes can be automatically applied, and this can be removed.
Steven Morelanda46371d2019-06-05 18:29:06 -0700119cc_library {
120 name: "libhidltransport",
Steven Morelanda46371d2019-06-05 18:29:06 -0700121 vendor_available: true,
Steven Moreland13420fe2019-10-09 16:28:44 -0700122
Dan Willemsenf35a0872020-06-09 15:09:11 -0700123 visibility: [
124 ":__subpackages__",
125 "//hardware:__subpackages__",
126 "//test/sts:__subpackages__",
127 "//vendor:__subpackages__",
128 ],
Steven Morelanda46371d2019-06-05 18:29:06 -0700129}
Steven Moreland55d2dcd2020-02-10 17:20:56 -0800130
131cc_defaults {
132 name: "libhidlbase-combined-impl",
133
134 defaults: [
135 "hidl-module-defaults",
136 "libhidl-defaults",
137 "libhwbinder-impl-shared-libs",
138 ],
139
140 shared_libs: [
141 "libbase",
142 "liblog",
143 "libutils",
144 "libcutils",
145 ],
146 export_shared_lib_headers: [
147 "libcutils", // for native_handle.h
148 "libutils",
149 ],
150 static_libs: [
151 "libhwbinder-impl-internal",
152 ],
153
154 target: {
155 android: {
156 shared_libs: [
157 "libvndksupport",
158 ],
159 },
160 recovery: {
161 exclude_shared_libs: [
162 "libvndksupport",
163 ],
164 },
165 },
166
167 export_include_dirs: [
168 "base/include",
169 "transport/include",
170 ],
171
Devin Mooref9893e82020-07-08 08:17:39 -0700172 header_libs: [
173 "libfmq-base",
174 ],
175 export_header_lib_headers: [
176 "libfmq-base",
177 ],
178
Steven Moreland55d2dcd2020-02-10 17:20:56 -0800179 generated_sources: [
180 "android.hidl.manager@1.0_genc++",
181 "android.hidl.manager@1.1_genc++",
182 "android.hidl.manager@1.2_genc++",
183 "android.hidl.base@1.0_genc++",
184 ],
185 generated_headers: [
186 "android.hidl.manager@1.0_genc++_headers",
187 "android.hidl.manager@1.1_genc++_headers",
188 "android.hidl.manager@1.2_genc++_headers",
189 "android.hidl.base@1.0_genc++_headers",
190 ],
191 export_generated_headers: [
192 "android.hidl.manager@1.0_genc++_headers",
193 "android.hidl.manager@1.1_genc++_headers",
194 "android.hidl.manager@1.2_genc++_headers",
195 "android.hidl.base@1.0_genc++_headers",
196 ],
197
198 srcs: [
199 "base/HidlInternal.cpp",
200 "base/HidlSupport.cpp",
201 "base/Status.cpp",
202 "base/TaskRunner.cpp",
203 "transport/HidlBinderSupport.cpp",
204 "transport/HidlLazyUtils.cpp",
205 "transport/HidlPassthroughSupport.cpp",
206 "transport/HidlTransportSupport.cpp",
207 "transport/HidlTransportUtils.cpp",
208 "transport/LegacySupport.cpp",
209 "transport/ServiceManagement.cpp",
210 "transport/Static.cpp",
211 ],
212
213 product_variables: {
214 debuggable: {
215 cflags: ["-DLIBHIDL_TARGET_DEBUGGABLE"],
216 },
217 enforce_vintf_manifest: {
218 cflags: ["-DENFORCE_VINTF_MANIFEST"],
219 },
220 },
221
222 sanitize: {
223 misc_undefined: ["integer"],
224 },
225}