blob: 33ba0e93139f48bf7252de159c5b396f2e060109 [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",
51 export_include_dirs: ["gtest_helper"],
Steven Morelande695c3e2019-08-21 15:36:22 -070052}
53
Yifan Hong00f4a392016-11-16 12:35:58 -080054cc_test {
55 name: "libhidl_test",
Steven Moreland2056cf32019-09-17 17:41:02 -070056 host_supported: true,
Steven Morelandc75fc622017-08-04 11:04:39 -070057 defaults: ["libhidl-defaults"],
Yifan Hong00f4a392016-11-16 12:35:58 -080058 gtest: false,
59 srcs: ["test_main.cpp"],
Steven Moreland17453832019-02-25 12:01:22 -080060 test_suites: ["device-tests"],
Yifan Hong00f4a392016-11-16 12:35:58 -080061
Dan Willemsen6365a872016-09-13 16:29:54 -070062 shared_libs: [
Steven Moreland138c3502018-11-27 14:27:04 -080063 "android.hidl.memory@1.0",
Dan Willemsen6365a872016-09-13 16:29:54 -070064 "libbase",
Steven Moreland348563a2019-06-19 13:53:19 -070065 "libhidlbase",
66 "liblog",
Dan Willemsen6365a872016-09-13 16:29:54 -070067 "libutils",
Jeff Tinker0f3461d2017-01-03 10:40:55 -080068 "libcutils",
Dan Willemsen6365a872016-09-13 16:29:54 -070069 ],
Steven Moreland55d2dcd2020-02-10 17:20:56 -080070 static_libs: [
71 "libgtest",
72 "libgmock",
73 ],
Yifan Hong00f4a392016-11-16 12:35:58 -080074
75 cflags: [
76 "-O0",
77 "-g",
Steven Morelandc75fc622017-08-04 11:04:39 -070078 ],
Dan Willemsen6365a872016-09-13 16:29:54 -070079}
Steven Morelanda46371d2019-06-05 18:29:06 -070080
Steven Moreland9f53eda2019-06-17 17:17:02 -070081cc_library {
82 name: "libhidlbase",
83 defaults: ["libhidlbase-combined-impl"],
Steven Moreland2056cf32019-09-17 17:41:02 -070084 host_supported: true,
Victor Khimenko538af7d2020-07-08 23:24:21 +020085 // TODO(b/153609531): remove when no longer needed.
86 native_bridge_supported: true,
Steven Moreland9f53eda2019-06-17 17:17:02 -070087 recovery_available: true,
88 vendor_available: true,
Justin Yun8ee97132020-11-11 19:23:49 +090089 product_available: true,
Przemyslaw Szczepaniak4f0d1e32020-02-13 20:01:04 +000090 apex_available: [
91 // TODO(b/137948090): not fully supported in APEX for certain usecases
92 // - large dependency sizes
93 // - VINTF manifest cannot be read from APEX
94 // - no testing story/infra for deprecation schedule
95 "//apex_available:platform",
96 "com.android.neuralnetworks",
97 "test_com.android.neuralnetworks",
Jiyong Park958a03f2020-03-07 17:23:16 +090098 "com.android.bluetooth.updatable",
99 "com.android.media",
100 "com.android.media.swcodec",
101 "com.android.tethering",
Przemyslaw Szczepaniak4f0d1e32020-02-13 20:01:04 +0000102 ],
Steven Moreland9f53eda2019-06-17 17:17:02 -0700103 vndk: {
104 enabled: true,
105 support_system_process: true,
106 },
107 whole_static_libs: [
108 "libhwbinder-impl-internal",
109 ],
Jooyung Handfe14f12020-04-16 18:48:34 +0900110 min_sdk_version: "29",
Steven Moreland9f53eda2019-06-17 17:17:02 -0700111}
112
113// Only libhwbinder_benchmark needs to have pgo enabled. When all places
114// support having PGO selectively enabled, all places can use libhwbinder.
115//
116// http://b/77320844
117cc_library {
118 name: "libhidlbase_pgo",
119 defaults: [
120 "libhidlbase-combined-impl",
121 "hwbinder_benchmark_pgo",
122 ],
123 whole_static_libs: [
124 "libhwbinder_pgo-impl-internal",
125 ],
Steven Morelandc6df5652019-09-05 15:08:41 -0700126
127 visibility: ["//system/libhwbinder:__subpackages__"],
Steven Moreland9f53eda2019-06-17 17:17:02 -0700128}
129
Steven Morelanda46371d2019-06-05 18:29:06 -0700130// WARNING: deprecated
Steven Morelanda29e20f2020-07-07 23:35:46 +0000131// This library is no longer required, and dependencies should be taken on libhidlbase instead.
132// 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 -0700133cc_library {
134 name: "libhidltransport",
Steven Morelanda46371d2019-06-05 18:29:06 -0700135 vendor_available: true,
Steven Moreland13420fe2019-10-09 16:28:44 -0700136
Dan Willemsenf35a0872020-06-09 15:09:11 -0700137 visibility: [
138 ":__subpackages__",
139 "//hardware:__subpackages__",
140 "//test/sts:__subpackages__",
141 "//vendor:__subpackages__",
142 ],
Steven Morelanda46371d2019-06-05 18:29:06 -0700143}
Steven Moreland55d2dcd2020-02-10 17:20:56 -0800144
145cc_defaults {
146 name: "libhidlbase-combined-impl",
147
148 defaults: [
149 "hidl-module-defaults",
150 "libhidl-defaults",
151 "libhwbinder-impl-shared-libs",
152 ],
153
154 shared_libs: [
155 "libbase",
156 "liblog",
157 "libutils",
158 "libcutils",
159 ],
160 export_shared_lib_headers: [
161 "libcutils", // for native_handle.h
162 "libutils",
163 ],
164 static_libs: [
165 "libhwbinder-impl-internal",
166 ],
167
168 target: {
169 android: {
170 shared_libs: [
171 "libvndksupport",
172 ],
173 },
174 recovery: {
175 exclude_shared_libs: [
176 "libvndksupport",
177 ],
178 },
179 },
180
181 export_include_dirs: [
182 "base/include",
183 "transport/include",
184 ],
185
Devin Mooref9893e82020-07-08 08:17:39 -0700186 header_libs: [
187 "libfmq-base",
188 ],
189 export_header_lib_headers: [
190 "libfmq-base",
191 ],
192
Steven Moreland55d2dcd2020-02-10 17:20:56 -0800193 generated_sources: [
194 "android.hidl.manager@1.0_genc++",
195 "android.hidl.manager@1.1_genc++",
196 "android.hidl.manager@1.2_genc++",
197 "android.hidl.base@1.0_genc++",
198 ],
199 generated_headers: [
200 "android.hidl.manager@1.0_genc++_headers",
201 "android.hidl.manager@1.1_genc++_headers",
202 "android.hidl.manager@1.2_genc++_headers",
203 "android.hidl.base@1.0_genc++_headers",
204 ],
205 export_generated_headers: [
206 "android.hidl.manager@1.0_genc++_headers",
207 "android.hidl.manager@1.1_genc++_headers",
208 "android.hidl.manager@1.2_genc++_headers",
209 "android.hidl.base@1.0_genc++_headers",
210 ],
211
212 srcs: [
213 "base/HidlInternal.cpp",
214 "base/HidlSupport.cpp",
215 "base/Status.cpp",
216 "base/TaskRunner.cpp",
217 "transport/HidlBinderSupport.cpp",
218 "transport/HidlLazyUtils.cpp",
219 "transport/HidlPassthroughSupport.cpp",
220 "transport/HidlTransportSupport.cpp",
221 "transport/HidlTransportUtils.cpp",
222 "transport/LegacySupport.cpp",
223 "transport/ServiceManagement.cpp",
224 "transport/Static.cpp",
225 ],
226
227 product_variables: {
228 debuggable: {
229 cflags: ["-DLIBHIDL_TARGET_DEBUGGABLE"],
230 },
231 enforce_vintf_manifest: {
232 cflags: ["-DENFORCE_VINTF_MANIFEST"],
233 },
234 },
235
236 sanitize: {
237 misc_undefined: ["integer"],
238 },
239}