blob: 9d268f62995bbacfab42dce4a57f752c7f8a27be [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,
60 srcs: ["test_main.cpp"],
Steven Moreland17453832019-02-25 12:01:22 -080061 test_suites: ["device-tests"],
Yifan Hong00f4a392016-11-16 12:35:58 -080062
Dan Willemsen6365a872016-09-13 16:29:54 -070063 shared_libs: [
Steven Moreland138c3502018-11-27 14:27:04 -080064 "android.hidl.memory@1.0",
Dan Willemsen6365a872016-09-13 16:29:54 -070065 "libbase",
Steven Moreland348563a2019-06-19 13:53:19 -070066 "libhidlbase",
67 "liblog",
Dan Willemsen6365a872016-09-13 16:29:54 -070068 "libutils",
Jeff Tinker0f3461d2017-01-03 10:40:55 -080069 "libcutils",
Dan Willemsen6365a872016-09-13 16:29:54 -070070 ],
Steven Moreland55d2dcd2020-02-10 17:20:56 -080071 static_libs: [
72 "libgtest",
73 "libgmock",
74 ],
Yifan Hong00f4a392016-11-16 12:35:58 -080075
76 cflags: [
77 "-O0",
78 "-g",
Steven Morelandc75fc622017-08-04 11:04:39 -070079 ],
Dan Willemsen6365a872016-09-13 16:29:54 -070080}
Steven Morelanda46371d2019-06-05 18:29:06 -070081
Steven Moreland9f53eda2019-06-17 17:17:02 -070082cc_library {
83 name: "libhidlbase",
84 defaults: ["libhidlbase-combined-impl"],
Steven Moreland2056cf32019-09-17 17:41:02 -070085 host_supported: true,
Victor Khimenko538af7d2020-07-08 23:24:21 +020086 // TODO(b/153609531): remove when no longer needed.
87 native_bridge_supported: true,
Steven Moreland9f53eda2019-06-17 17:17:02 -070088 recovery_available: true,
89 vendor_available: true,
Justin Yun8ee97132020-11-11 19:23:49 +090090 product_available: true,
Przemyslaw Szczepaniak4f0d1e32020-02-13 20:01:04 +000091 apex_available: [
92 // TODO(b/137948090): not fully supported in APEX for certain usecases
93 // - large dependency sizes
94 // - VINTF manifest cannot be read from APEX
95 // - no testing story/infra for deprecation schedule
96 "//apex_available:platform",
97 "com.android.neuralnetworks",
98 "test_com.android.neuralnetworks",
Etienne Ruffieuxa7085792021-12-15 15:35:59 +000099 "com.android.bluetooth",
Jiyong Park958a03f2020-03-07 17:23:16 +0900100 "com.android.media",
101 "com.android.media.swcodec",
102 "com.android.tethering",
Przemyslaw Szczepaniak4f0d1e32020-02-13 20:01:04 +0000103 ],
Steven Moreland9f53eda2019-06-17 17:17:02 -0700104 vndk: {
105 enabled: true,
106 support_system_process: true,
107 },
108 whole_static_libs: [
109 "libhwbinder-impl-internal",
110 ],
Jooyung Handfe14f12020-04-16 18:48:34 +0900111 min_sdk_version: "29",
Yi Kong314387e2022-01-12 09:39:19 +0800112 afdo: true,
Steven Moreland9f53eda2019-06-17 17:17:02 -0700113}
114
Steven Morelanda46371d2019-06-05 18:29:06 -0700115// WARNING: deprecated
Steven Morelanda29e20f2020-07-07 23:35:46 +0000116// This library is no longer required, and dependencies should be taken on libhidlbase instead.
117// 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 -0700118cc_library {
119 name: "libhidltransport",
Steven Morelanda46371d2019-06-05 18:29:06 -0700120 vendor_available: true,
Steven Moreland13420fe2019-10-09 16:28:44 -0700121
Dan Willemsenf35a0872020-06-09 15:09:11 -0700122 visibility: [
123 ":__subpackages__",
124 "//hardware:__subpackages__",
125 "//test/sts:__subpackages__",
126 "//vendor:__subpackages__",
127 ],
Steven Morelanda46371d2019-06-05 18:29:06 -0700128}
Steven Moreland55d2dcd2020-02-10 17:20:56 -0800129
130cc_defaults {
131 name: "libhidlbase-combined-impl",
132
133 defaults: [
134 "hidl-module-defaults",
135 "libhidl-defaults",
136 "libhwbinder-impl-shared-libs",
137 ],
138
139 shared_libs: [
140 "libbase",
141 "liblog",
142 "libutils",
143 "libcutils",
144 ],
145 export_shared_lib_headers: [
146 "libcutils", // for native_handle.h
147 "libutils",
148 ],
149 static_libs: [
150 "libhwbinder-impl-internal",
151 ],
152
153 target: {
154 android: {
155 shared_libs: [
156 "libvndksupport",
157 ],
158 },
159 recovery: {
160 exclude_shared_libs: [
161 "libvndksupport",
162 ],
163 },
164 },
165
166 export_include_dirs: [
167 "base/include",
168 "transport/include",
169 ],
170
Devin Mooref9893e82020-07-08 08:17:39 -0700171 header_libs: [
172 "libfmq-base",
173 ],
174 export_header_lib_headers: [
175 "libfmq-base",
176 ],
177
Steven Moreland55d2dcd2020-02-10 17:20:56 -0800178 generated_sources: [
179 "android.hidl.manager@1.0_genc++",
180 "android.hidl.manager@1.1_genc++",
181 "android.hidl.manager@1.2_genc++",
182 "android.hidl.base@1.0_genc++",
183 ],
184 generated_headers: [
185 "android.hidl.manager@1.0_genc++_headers",
186 "android.hidl.manager@1.1_genc++_headers",
187 "android.hidl.manager@1.2_genc++_headers",
188 "android.hidl.base@1.0_genc++_headers",
189 ],
190 export_generated_headers: [
191 "android.hidl.manager@1.0_genc++_headers",
192 "android.hidl.manager@1.1_genc++_headers",
193 "android.hidl.manager@1.2_genc++_headers",
194 "android.hidl.base@1.0_genc++_headers",
195 ],
196
197 srcs: [
198 "base/HidlInternal.cpp",
199 "base/HidlSupport.cpp",
200 "base/Status.cpp",
201 "base/TaskRunner.cpp",
202 "transport/HidlBinderSupport.cpp",
203 "transport/HidlLazyUtils.cpp",
204 "transport/HidlPassthroughSupport.cpp",
205 "transport/HidlTransportSupport.cpp",
206 "transport/HidlTransportUtils.cpp",
207 "transport/LegacySupport.cpp",
208 "transport/ServiceManagement.cpp",
209 "transport/Static.cpp",
210 ],
211
212 product_variables: {
213 debuggable: {
214 cflags: ["-DLIBHIDL_TARGET_DEBUGGABLE"],
215 },
216 enforce_vintf_manifest: {
217 cflags: ["-DENFORCE_VINTF_MANIFEST"],
218 },
219 },
220
221 sanitize: {
222 misc_undefined: ["integer"],
223 },
224}