blob: 2b9e80fb69bdd13be7e4f7d35022468977686a74 [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 Khimenko538af7d2020-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 Park958a03f2020-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 Handfe14f12020-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
Dan Willemsenf35a0872020-06-09 15:09:11 -0700127 visibility: [
128 ":__subpackages__",
129 "//hardware:__subpackages__",
130 "//test/sts:__subpackages__",
131 "//vendor:__subpackages__",
132 ],
Steven Morelanda46371d2019-06-05 18:29:06 -0700133}
Steven Moreland55d2dcd2020-02-10 17:20:56 -0800134
135cc_defaults {
136 name: "libhidlbase-combined-impl",
137
138 defaults: [
139 "hidl-module-defaults",
140 "libhidl-defaults",
141 "libhwbinder-impl-shared-libs",
142 ],
143
144 shared_libs: [
145 "libbase",
146 "liblog",
147 "libutils",
148 "libcutils",
149 ],
150 export_shared_lib_headers: [
151 "libcutils", // for native_handle.h
152 "libutils",
153 ],
154 static_libs: [
155 "libhwbinder-impl-internal",
156 ],
157
158 target: {
159 android: {
160 shared_libs: [
161 "libvndksupport",
162 ],
163 },
164 recovery: {
165 exclude_shared_libs: [
166 "libvndksupport",
167 ],
168 },
169 },
170
171 export_include_dirs: [
172 "base/include",
173 "transport/include",
174 ],
175
Devin Mooref9893e82020-07-08 08:17:39 -0700176 header_libs: [
177 "libfmq-base",
178 ],
179 export_header_lib_headers: [
180 "libfmq-base",
181 ],
182
Steven Moreland55d2dcd2020-02-10 17:20:56 -0800183 generated_sources: [
184 "android.hidl.manager@1.0_genc++",
185 "android.hidl.manager@1.1_genc++",
186 "android.hidl.manager@1.2_genc++",
187 "android.hidl.base@1.0_genc++",
188 ],
189 generated_headers: [
190 "android.hidl.manager@1.0_genc++_headers",
191 "android.hidl.manager@1.1_genc++_headers",
192 "android.hidl.manager@1.2_genc++_headers",
193 "android.hidl.base@1.0_genc++_headers",
194 ],
195 export_generated_headers: [
196 "android.hidl.manager@1.0_genc++_headers",
197 "android.hidl.manager@1.1_genc++_headers",
198 "android.hidl.manager@1.2_genc++_headers",
199 "android.hidl.base@1.0_genc++_headers",
200 ],
201
202 srcs: [
203 "base/HidlInternal.cpp",
204 "base/HidlSupport.cpp",
205 "base/Status.cpp",
206 "base/TaskRunner.cpp",
207 "transport/HidlBinderSupport.cpp",
208 "transport/HidlLazyUtils.cpp",
209 "transport/HidlPassthroughSupport.cpp",
210 "transport/HidlTransportSupport.cpp",
211 "transport/HidlTransportUtils.cpp",
212 "transport/LegacySupport.cpp",
213 "transport/ServiceManagement.cpp",
214 "transport/Static.cpp",
215 ],
216
217 product_variables: {
218 debuggable: {
219 cflags: ["-DLIBHIDL_TARGET_DEBUGGABLE"],
220 },
221 enforce_vintf_manifest: {
222 cflags: ["-DENFORCE_VINTF_MANIFEST"],
223 },
224 },
225
226 sanitize: {
227 misc_undefined: ["integer"],
228 },
229}