blob: 738258e1bb1456bc5ca44d6e8e17928632fcc381 [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",
Jayant Chowdharyd17de9f2022-05-18 06:51:51 +000051 vendor_available: true,
Michael Butler93923732022-01-12 13:42:23 -080052 host_supported: true,
Steven Morelandbecd44e2019-10-29 14:20:00 -070053 export_include_dirs: ["gtest_helper"],
Steven Morelande695c3e2019-08-21 15:36:22 -070054}
55
Yifan Hong00f4a392016-11-16 12:35:58 -080056cc_test {
57 name: "libhidl_test",
Steven Moreland2056cf32019-09-17 17:41:02 -070058 host_supported: true,
Steven Morelandc75fc622017-08-04 11:04:39 -070059 defaults: ["libhidl-defaults"],
Yifan Hong00f4a392016-11-16 12:35:58 -080060 gtest: false,
Chih-Hung Hsieh415623f2022-02-17 17:27:15 -080061 tidy_timeout_srcs: ["test_main.cpp"],
Yifan Hong00f4a392016-11-16 12:35:58 -080062 srcs: ["test_main.cpp"],
Steven Moreland17453832019-02-25 12:01:22 -080063 test_suites: ["device-tests"],
Yifan Hong00f4a392016-11-16 12:35:58 -080064
Dan Willemsen6365a872016-09-13 16:29:54 -070065 shared_libs: [
Steven Moreland138c3502018-11-27 14:27:04 -080066 "android.hidl.memory@1.0",
Dan Willemsen6365a872016-09-13 16:29:54 -070067 "libbase",
Steven Moreland348563a2019-06-19 13:53:19 -070068 "libhidlbase",
69 "liblog",
Dan Willemsen6365a872016-09-13 16:29:54 -070070 "libutils",
Jeff Tinker0f3461d2017-01-03 10:40:55 -080071 "libcutils",
Dan Willemsen6365a872016-09-13 16:29:54 -070072 ],
Steven Moreland55d2dcd2020-02-10 17:20:56 -080073 static_libs: [
74 "libgtest",
75 "libgmock",
76 ],
Yifan Hong00f4a392016-11-16 12:35:58 -080077
78 cflags: [
79 "-O0",
80 "-g",
Steven Morelandc75fc622017-08-04 11:04:39 -070081 ],
Dan Willemsen6365a872016-09-13 16:29:54 -070082}
Steven Morelanda46371d2019-06-05 18:29:06 -070083
Steven Moreland9f53eda2019-06-17 17:17:02 -070084cc_library {
85 name: "libhidlbase",
86 defaults: ["libhidlbase-combined-impl"],
Steven Moreland2056cf32019-09-17 17:41:02 -070087 host_supported: true,
Victor Khimenkofd83b6b2020-07-08 23:24:21 +020088 // TODO(b/153609531): remove when no longer needed.
89 native_bridge_supported: true,
Steven Moreland9f53eda2019-06-17 17:17:02 -070090 recovery_available: true,
91 vendor_available: true,
Justin Yun8ee97132020-11-11 19:23:49 +090092 product_available: true,
Przemyslaw Szczepaniak4f0d1e32020-02-13 20:01:04 +000093 apex_available: [
94 // TODO(b/137948090): not fully supported in APEX for certain usecases
95 // - large dependency sizes
96 // - VINTF manifest cannot be read from APEX
97 // - no testing story/infra for deprecation schedule
98 "//apex_available:platform",
99 "com.android.neuralnetworks",
100 "test_com.android.neuralnetworks",
Etienne Ruffieuxa7085792021-12-15 15:35:59 +0000101 "com.android.bluetooth",
Jiyong Park650f70f2020-03-07 17:23:16 +0900102 "com.android.media",
103 "com.android.media.swcodec",
104 "com.android.tethering",
Przemyslaw Szczepaniak4f0d1e32020-02-13 20:01:04 +0000105 ],
Steven Moreland9f53eda2019-06-17 17:17:02 -0700106 vndk: {
107 enabled: true,
108 support_system_process: true,
109 },
110 whole_static_libs: [
111 "libhwbinder-impl-internal",
112 ],
Jooyung Hand3383782020-04-16 18:48:34 +0900113 min_sdk_version: "29",
Yi Kong314387e2022-01-12 09:39:19 +0800114 afdo: true,
Hsin-Yi Chen36971662022-05-26 14:00:56 +0800115 header_abi_checker: {
116 diff_flags: ["-allow-adding-removing-weak-symbols"],
117 },
Steven Moreland9f53eda2019-06-17 17:17:02 -0700118}
119
Steven Morelanda46371d2019-06-05 18:29:06 -0700120// WARNING: deprecated
Steven Morelanda29e20f2020-07-07 23:35:46 +0000121// This library is no longer required, and dependencies should be taken on libhidlbase instead.
122// 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 -0700123cc_library {
124 name: "libhidltransport",
Steven Morelanda46371d2019-06-05 18:29:06 -0700125 vendor_available: true,
Steven Moreland13420fe2019-10-09 16:28:44 -0700126
Daniel Normanc01d4172020-08-31 12:05:48 -0700127 // TODO(b/144056694) Add back the subpackages visibility restriction.
128 // visibility: [
129 // ":__subpackages__",
130 // "//hardware:__subpackages__",
131 // "//test/sts:__subpackages__",
132 // "//vendor:__subpackages__",
133 // ],
Steven Morelanda46371d2019-06-05 18:29:06 -0700134}
Steven Moreland55d2dcd2020-02-10 17:20:56 -0800135
136cc_defaults {
137 name: "libhidlbase-combined-impl",
138
139 defaults: [
140 "hidl-module-defaults",
141 "libhidl-defaults",
142 "libhwbinder-impl-shared-libs",
143 ],
144
145 shared_libs: [
146 "libbase",
147 "liblog",
148 "libutils",
149 "libcutils",
150 ],
151 export_shared_lib_headers: [
152 "libcutils", // for native_handle.h
153 "libutils",
154 ],
155 static_libs: [
156 "libhwbinder-impl-internal",
157 ],
158
159 target: {
160 android: {
161 shared_libs: [
162 "libvndksupport",
163 ],
164 },
165 recovery: {
166 exclude_shared_libs: [
167 "libvndksupport",
168 ],
169 },
170 },
171
172 export_include_dirs: [
173 "base/include",
174 "transport/include",
175 ],
176
Devin Mooref9893e82020-07-08 08:17:39 -0700177 header_libs: [
178 "libfmq-base",
179 ],
180 export_header_lib_headers: [
181 "libfmq-base",
182 ],
183
Steven Moreland55d2dcd2020-02-10 17:20:56 -0800184 generated_sources: [
185 "android.hidl.manager@1.0_genc++",
186 "android.hidl.manager@1.1_genc++",
187 "android.hidl.manager@1.2_genc++",
188 "android.hidl.base@1.0_genc++",
189 ],
190 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 export_generated_headers: [
197 "android.hidl.manager@1.0_genc++_headers",
198 "android.hidl.manager@1.1_genc++_headers",
199 "android.hidl.manager@1.2_genc++_headers",
200 "android.hidl.base@1.0_genc++_headers",
201 ],
202
203 srcs: [
204 "base/HidlInternal.cpp",
205 "base/HidlSupport.cpp",
206 "base/Status.cpp",
207 "base/TaskRunner.cpp",
208 "transport/HidlBinderSupport.cpp",
209 "transport/HidlLazyUtils.cpp",
210 "transport/HidlPassthroughSupport.cpp",
211 "transport/HidlTransportSupport.cpp",
212 "transport/HidlTransportUtils.cpp",
213 "transport/LegacySupport.cpp",
214 "transport/ServiceManagement.cpp",
215 "transport/Static.cpp",
216 ],
217
218 product_variables: {
219 debuggable: {
220 cflags: ["-DLIBHIDL_TARGET_DEBUGGABLE"],
221 },
222 enforce_vintf_manifest: {
223 cflags: ["-DENFORCE_VINTF_MANIFEST"],
224 },
225 },
226
227 sanitize: {
228 misc_undefined: ["integer"],
229 },
230}