blob: 6edb2e37167e2e952b5e445c59ce3b4e7ece56d3 [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 {
Aditya Choudhary63f40502024-02-02 13:58:06 +000016 default_team: "trendy_team_android_kernel",
Bob Badourad2415c2021-02-12 17:33:30 -080017 default_applicable_licenses: ["system_libhidl_license"],
18}
19
20// Added automatically by a large-scale-change
21// See: http://go/android-license-faq
22license {
23 name: "system_libhidl_license",
24 visibility: [":__subpackages__"],
25 license_kinds: [
26 "SPDX-license-identifier-Apache-2.0",
27 ],
28 license_text: [
29 "NOTICE",
30 ],
31}
32
Steven Morelandc75fc622017-08-04 11:04:39 -070033cc_defaults {
34 name: "libhidl-defaults",
35 cflags: [
36 "-Wall",
Steven Moreland37814cb2018-10-24 16:28:35 -070037 "-Wdocumentation", // since some users use this
Steven Morelandc75fc622017-08-04 11:04:39 -070038 "-Werror",
Bernhard Rosenkränzer0c28fd22018-06-04 16:01:47 +020039 "-Wextra-semi",
Steven Morelandc75fc622017-08-04 11:04:39 -070040 ],
41}
Steven Moreland8dd65742017-02-17 22:39:46 -080042
Steven Moreland37e8d3a2019-04-26 12:33:21 -070043phony {
44 name: "libhidl",
45 required: [
46 "libhidlbase",
Steven Moreland37e8d3a2019-04-26 12:33:21 -070047 ],
48}
49
Steven Morelande695c3e2019-08-21 15:36:22 -070050cc_library_headers {
Steven Morelandbecd44e2019-10-29 14:20:00 -070051 name: "libhidl_gtest_helper",
Jayant Chowdharyd17de9f2022-05-18 06:51:51 +000052 vendor_available: true,
Michael Butler93923732022-01-12 13:42:23 -080053 host_supported: true,
Steven Morelandbecd44e2019-10-29 14:20:00 -070054 export_include_dirs: ["gtest_helper"],
Steven Morelande695c3e2019-08-21 15:36:22 -070055}
56
Yifan Hong00f4a392016-11-16 12:35:58 -080057cc_test {
58 name: "libhidl_test",
Steven Moreland2056cf32019-09-17 17:41:02 -070059 host_supported: true,
Steven Morelandc75fc622017-08-04 11:04:39 -070060 defaults: ["libhidl-defaults"],
Yifan Hong00f4a392016-11-16 12:35:58 -080061 gtest: false,
Chih-Hung Hsieh415623f2022-02-17 17:27:15 -080062 tidy_timeout_srcs: ["test_main.cpp"],
Yifan Hong00f4a392016-11-16 12:35:58 -080063 srcs: ["test_main.cpp"],
Steven Moreland17453832019-02-25 12:01:22 -080064 test_suites: ["device-tests"],
Yifan Hong00f4a392016-11-16 12:35:58 -080065
Dan Willemsen6365a872016-09-13 16:29:54 -070066 shared_libs: [
Steven Moreland138c3502018-11-27 14:27:04 -080067 "android.hidl.memory@1.0",
Dan Willemsen6365a872016-09-13 16:29:54 -070068 "libbase",
Steven Moreland348563a2019-06-19 13:53:19 -070069 "libhidlbase",
70 "liblog",
Dan Willemsen6365a872016-09-13 16:29:54 -070071 "libutils",
Jeff Tinker0f3461d2017-01-03 10:40:55 -080072 "libcutils",
Dan Willemsen6365a872016-09-13 16:29:54 -070073 ],
Steven Moreland55d2dcd2020-02-10 17:20:56 -080074 static_libs: [
75 "libgtest",
76 "libgmock",
77 ],
Yifan Hong00f4a392016-11-16 12:35:58 -080078
79 cflags: [
80 "-O0",
81 "-g",
Steven Morelandc75fc622017-08-04 11:04:39 -070082 ],
Dan Willemsen6365a872016-09-13 16:29:54 -070083}
Steven Morelanda46371d2019-06-05 18:29:06 -070084
Steven Moreland9f53eda2019-06-17 17:17:02 -070085cc_library {
86 name: "libhidlbase",
87 defaults: ["libhidlbase-combined-impl"],
Steven Moreland2056cf32019-09-17 17:41:02 -070088 host_supported: true,
Victor Khimenko538af7d2020-07-08 23:24:21 +020089 // TODO(b/153609531): remove when no longer needed.
90 native_bridge_supported: true,
Steven Moreland9f53eda2019-06-17 17:17:02 -070091 recovery_available: true,
92 vendor_available: true,
Justin Yun8ee97132020-11-11 19:23:49 +090093 product_available: true,
Przemyslaw Szczepaniak4f0d1e32020-02-13 20:01:04 +000094 apex_available: [
95 // TODO(b/137948090): not fully supported in APEX for certain usecases
96 // - large dependency sizes
97 // - VINTF manifest cannot be read from APEX
98 // - no testing story/infra for deprecation schedule
99 "//apex_available:platform",
100 "com.android.neuralnetworks",
101 "test_com.android.neuralnetworks",
William Escandefc94fbc2022-08-22 11:28:01 -0700102 "com.android.btservices",
Jiyong Park958a03f2020-03-07 17:23:16 +0900103 "com.android.media",
104 "com.android.media.swcodec",
Roshan Pius687f3b82023-10-04 12:56:13 -0700105 "com.android.nfcservices",
Jiyong Park958a03f2020-03-07 17:23:16 +0900106 "com.android.tethering",
Przemyslaw Szczepaniak4f0d1e32020-02-13 20:01:04 +0000107 ],
Steven Moreland9f53eda2019-06-17 17:17:02 -0700108 vndk: {
109 enabled: true,
110 support_system_process: true,
111 },
112 whole_static_libs: [
113 "libhwbinder-impl-internal",
114 ],
Jooyung Handfe14f12020-04-16 18:48:34 +0900115 min_sdk_version: "29",
Yi Kong314387e2022-01-12 09:39:19 +0800116 afdo: true,
Steven Moreland9f53eda2019-06-17 17:17:02 -0700117}
118
Steven Morelanda46371d2019-06-05 18:29:06 -0700119// WARNING: deprecated
Steven Morelanda29e20f2020-07-07 23:35:46 +0000120// This library is no longer required, and dependencies should be taken on libhidlbase instead.
121// 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 -0700122cc_library {
123 name: "libhidltransport",
Steven Morelanda46371d2019-06-05 18:29:06 -0700124 vendor_available: true,
Steven Moreland13420fe2019-10-09 16:28:44 -0700125
Dan Willemsenf35a0872020-06-09 15:09:11 -0700126 visibility: [
127 ":__subpackages__",
128 "//hardware:__subpackages__",
129 "//test/sts:__subpackages__",
130 "//vendor:__subpackages__",
131 ],
Steven Morelanda46371d2019-06-05 18:29:06 -0700132}
Steven Moreland55d2dcd2020-02-10 17:20:56 -0800133
134cc_defaults {
135 name: "libhidlbase-combined-impl",
136
137 defaults: [
138 "hidl-module-defaults",
139 "libhidl-defaults",
140 "libhwbinder-impl-shared-libs",
141 ],
142
143 shared_libs: [
144 "libbase",
145 "liblog",
146 "libutils",
147 "libcutils",
148 ],
149 export_shared_lib_headers: [
150 "libcutils", // for native_handle.h
151 "libutils",
152 ],
153 static_libs: [
154 "libhwbinder-impl-internal",
155 ],
156
157 target: {
158 android: {
159 shared_libs: [
160 "libvndksupport",
161 ],
162 },
163 recovery: {
164 exclude_shared_libs: [
165 "libvndksupport",
166 ],
167 },
168 },
169
170 export_include_dirs: [
171 "base/include",
172 "transport/include",
173 ],
174
Devin Mooref9893e82020-07-08 08:17:39 -0700175 header_libs: [
176 "libfmq-base",
177 ],
178 export_header_lib_headers: [
179 "libfmq-base",
180 ],
181
Steven Moreland55d2dcd2020-02-10 17:20:56 -0800182 generated_sources: [
183 "android.hidl.manager@1.0_genc++",
184 "android.hidl.manager@1.1_genc++",
185 "android.hidl.manager@1.2_genc++",
186 "android.hidl.base@1.0_genc++",
187 ],
188 generated_headers: [
189 "android.hidl.manager@1.0_genc++_headers",
190 "android.hidl.manager@1.1_genc++_headers",
191 "android.hidl.manager@1.2_genc++_headers",
192 "android.hidl.base@1.0_genc++_headers",
193 ],
194 export_generated_headers: [
195 "android.hidl.manager@1.0_genc++_headers",
196 "android.hidl.manager@1.1_genc++_headers",
197 "android.hidl.manager@1.2_genc++_headers",
198 "android.hidl.base@1.0_genc++_headers",
199 ],
200
201 srcs: [
202 "base/HidlInternal.cpp",
203 "base/HidlSupport.cpp",
204 "base/Status.cpp",
205 "base/TaskRunner.cpp",
206 "transport/HidlBinderSupport.cpp",
207 "transport/HidlLazyUtils.cpp",
208 "transport/HidlPassthroughSupport.cpp",
209 "transport/HidlTransportSupport.cpp",
210 "transport/HidlTransportUtils.cpp",
211 "transport/LegacySupport.cpp",
212 "transport/ServiceManagement.cpp",
213 "transport/Static.cpp",
214 ],
215
216 product_variables: {
217 debuggable: {
218 cflags: ["-DLIBHIDL_TARGET_DEBUGGABLE"],
219 },
220 enforce_vintf_manifest: {
221 cflags: ["-DENFORCE_VINTF_MANIFEST"],
222 },
223 },
224
225 sanitize: {
226 misc_undefined: ["integer"],
227 },
228}