blob: ff918ed58c6835c2a61d35830f6216d1eeb3d325 [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
Steven Morelandc75fc622017-08-04 11:04:39 -070015cc_defaults {
16 name: "libhidl-defaults",
17 cflags: [
18 "-Wall",
Steven Moreland37814cb2018-10-24 16:28:35 -070019 "-Wdocumentation", // since some users use this
Steven Morelandc75fc622017-08-04 11:04:39 -070020 "-Werror",
Bernhard Rosenkränzer0c28fd22018-06-04 16:01:47 +020021 "-Wextra-semi",
Steven Morelandc75fc622017-08-04 11:04:39 -070022 ],
23}
Steven Moreland8dd65742017-02-17 22:39:46 -080024
Steven Moreland37e8d3a2019-04-26 12:33:21 -070025phony {
26 name: "libhidl",
27 required: [
28 "libhidlbase",
Steven Moreland37e8d3a2019-04-26 12:33:21 -070029 ],
30}
31
Steven Morelande695c3e2019-08-21 15:36:22 -070032cc_library_headers {
Steven Morelandbecd44e2019-10-29 14:20:00 -070033 name: "libhidl_gtest_helper",
34 export_include_dirs: ["gtest_helper"],
Steven Morelande695c3e2019-08-21 15:36:22 -070035}
36
Yifan Hong00f4a392016-11-16 12:35:58 -080037cc_test {
38 name: "libhidl_test",
Steven Moreland2056cf32019-09-17 17:41:02 -070039 host_supported: true,
Steven Morelandc75fc622017-08-04 11:04:39 -070040 defaults: ["libhidl-defaults"],
Yifan Hong00f4a392016-11-16 12:35:58 -080041 gtest: false,
42 srcs: ["test_main.cpp"],
Steven Moreland17453832019-02-25 12:01:22 -080043 test_suites: ["device-tests"],
Yifan Hong00f4a392016-11-16 12:35:58 -080044
Dan Willemsen6365a872016-09-13 16:29:54 -070045 shared_libs: [
Steven Moreland138c3502018-11-27 14:27:04 -080046 "android.hidl.memory@1.0",
Dan Willemsen6365a872016-09-13 16:29:54 -070047 "libbase",
Steven Moreland348563a2019-06-19 13:53:19 -070048 "libhidlbase",
49 "liblog",
Dan Willemsen6365a872016-09-13 16:29:54 -070050 "libutils",
Jeff Tinker0f3461d2017-01-03 10:40:55 -080051 "libcutils",
Dan Willemsen6365a872016-09-13 16:29:54 -070052 ],
Steven Moreland55d2dcd2020-02-10 17:20:56 -080053 static_libs: [
54 "libgtest",
55 "libgmock",
56 ],
Yifan Hong00f4a392016-11-16 12:35:58 -080057
58 cflags: [
59 "-O0",
60 "-g",
Steven Morelandc75fc622017-08-04 11:04:39 -070061 ],
Dan Willemsen6365a872016-09-13 16:29:54 -070062}
Steven Morelanda46371d2019-06-05 18:29:06 -070063
Steven Moreland9f53eda2019-06-17 17:17:02 -070064cc_library {
65 name: "libhidlbase",
66 defaults: ["libhidlbase-combined-impl"],
Steven Moreland2056cf32019-09-17 17:41:02 -070067 host_supported: true,
Victor Khimenko538af7d2020-07-08 23:24:21 +020068 // TODO(b/153609531): remove when no longer needed.
69 native_bridge_supported: true,
Steven Moreland9f53eda2019-06-17 17:17:02 -070070 recovery_available: true,
71 vendor_available: true,
Przemyslaw Szczepaniak4f0d1e32020-02-13 20:01:04 +000072 apex_available: [
73 // TODO(b/137948090): not fully supported in APEX for certain usecases
74 // - large dependency sizes
75 // - VINTF manifest cannot be read from APEX
76 // - no testing story/infra for deprecation schedule
77 "//apex_available:platform",
78 "com.android.neuralnetworks",
79 "test_com.android.neuralnetworks",
Jiyong Park958a03f2020-03-07 17:23:16 +090080 "com.android.bluetooth.updatable",
81 "com.android.media",
82 "com.android.media.swcodec",
83 "com.android.tethering",
Przemyslaw Szczepaniak4f0d1e32020-02-13 20:01:04 +000084 ],
Steven Moreland9f53eda2019-06-17 17:17:02 -070085 vndk: {
86 enabled: true,
87 support_system_process: true,
88 },
89 whole_static_libs: [
90 "libhwbinder-impl-internal",
91 ],
Jooyung Handfe14f12020-04-16 18:48:34 +090092 min_sdk_version: "29",
Steven Moreland9f53eda2019-06-17 17:17:02 -070093}
94
95// Only libhwbinder_benchmark needs to have pgo enabled. When all places
96// support having PGO selectively enabled, all places can use libhwbinder.
97//
98// http://b/77320844
99cc_library {
100 name: "libhidlbase_pgo",
101 defaults: [
102 "libhidlbase-combined-impl",
103 "hwbinder_benchmark_pgo",
104 ],
105 whole_static_libs: [
106 "libhwbinder_pgo-impl-internal",
107 ],
Steven Morelandc6df5652019-09-05 15:08:41 -0700108
109 visibility: ["//system/libhwbinder:__subpackages__"],
Steven Moreland9f53eda2019-06-17 17:17:02 -0700110}
111
Steven Morelanda46371d2019-06-05 18:29:06 -0700112// WARNING: deprecated
Steven Morelanda29e20f2020-07-07 23:35:46 +0000113// This library is no longer required, and dependencies should be taken on libhidlbase instead.
114// 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 -0700115cc_library {
116 name: "libhidltransport",
Steven Morelanda46371d2019-06-05 18:29:06 -0700117 vendor_available: true,
Steven Morelanda46371d2019-06-05 18:29:06 -0700118}
Steven Moreland55d2dcd2020-02-10 17:20:56 -0800119
120cc_defaults {
121 name: "libhidlbase-combined-impl",
122
123 defaults: [
124 "hidl-module-defaults",
125 "libhidl-defaults",
126 "libhwbinder-impl-shared-libs",
127 ],
128
129 shared_libs: [
130 "libbase",
131 "liblog",
132 "libutils",
133 "libcutils",
134 ],
135 export_shared_lib_headers: [
136 "libcutils", // for native_handle.h
137 "libutils",
138 ],
139 static_libs: [
140 "libhwbinder-impl-internal",
141 ],
142
143 target: {
144 android: {
145 shared_libs: [
146 "libvndksupport",
147 ],
148 },
149 recovery: {
150 exclude_shared_libs: [
151 "libvndksupport",
152 ],
153 },
154 },
155
156 export_include_dirs: [
157 "base/include",
158 "transport/include",
159 ],
160
Devin Mooref9893e82020-07-08 08:17:39 -0700161 header_libs: [
162 "libfmq-base",
163 ],
164 export_header_lib_headers: [
165 "libfmq-base",
166 ],
167
Steven Moreland55d2dcd2020-02-10 17:20:56 -0800168 generated_sources: [
169 "android.hidl.manager@1.0_genc++",
170 "android.hidl.manager@1.1_genc++",
171 "android.hidl.manager@1.2_genc++",
172 "android.hidl.base@1.0_genc++",
173 ],
174 generated_headers: [
175 "android.hidl.manager@1.0_genc++_headers",
176 "android.hidl.manager@1.1_genc++_headers",
177 "android.hidl.manager@1.2_genc++_headers",
178 "android.hidl.base@1.0_genc++_headers",
179 ],
180 export_generated_headers: [
181 "android.hidl.manager@1.0_genc++_headers",
182 "android.hidl.manager@1.1_genc++_headers",
183 "android.hidl.manager@1.2_genc++_headers",
184 "android.hidl.base@1.0_genc++_headers",
185 ],
186
187 srcs: [
188 "base/HidlInternal.cpp",
189 "base/HidlSupport.cpp",
190 "base/Status.cpp",
191 "base/TaskRunner.cpp",
192 "transport/HidlBinderSupport.cpp",
193 "transport/HidlLazyUtils.cpp",
194 "transport/HidlPassthroughSupport.cpp",
195 "transport/HidlTransportSupport.cpp",
196 "transport/HidlTransportUtils.cpp",
197 "transport/LegacySupport.cpp",
198 "transport/ServiceManagement.cpp",
199 "transport/Static.cpp",
200 ],
201
202 product_variables: {
203 debuggable: {
204 cflags: ["-DLIBHIDL_TARGET_DEBUGGABLE"],
205 },
206 enforce_vintf_manifest: {
207 cflags: ["-DENFORCE_VINTF_MANIFEST"],
208 },
209 },
210
211 sanitize: {
212 misc_undefined: ["integer"],
213 },
214}