Dan Willemsen | 6365a87 | 2016-09-13 16:29:54 -0700 | [diff] [blame] | 1 | // 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 Moreland | c75fc62 | 2017-08-04 11:04:39 -0700 | [diff] [blame] | 15 | cc_defaults { |
| 16 | name: "libhidl-defaults", |
| 17 | cflags: [ |
| 18 | "-Wall", |
Steven Moreland | 37814cb | 2018-10-24 16:28:35 -0700 | [diff] [blame] | 19 | "-Wdocumentation", // since some users use this |
Steven Moreland | c75fc62 | 2017-08-04 11:04:39 -0700 | [diff] [blame] | 20 | "-Werror", |
Bernhard Rosenkränzer | 0c28fd2 | 2018-06-04 16:01:47 +0200 | [diff] [blame] | 21 | "-Wextra-semi", |
Steven Moreland | c75fc62 | 2017-08-04 11:04:39 -0700 | [diff] [blame] | 22 | ], |
| 23 | } |
Steven Moreland | 8dd6574 | 2017-02-17 22:39:46 -0800 | [diff] [blame] | 24 | |
Steven Moreland | 37e8d3a | 2019-04-26 12:33:21 -0700 | [diff] [blame] | 25 | phony { |
| 26 | name: "libhidl", |
| 27 | required: [ |
| 28 | "libhidlbase", |
Steven Moreland | 37e8d3a | 2019-04-26 12:33:21 -0700 | [diff] [blame] | 29 | ], |
| 30 | } |
| 31 | |
Steven Moreland | e695c3e | 2019-08-21 15:36:22 -0700 | [diff] [blame] | 32 | cc_library_headers { |
Steven Moreland | becd44e | 2019-10-29 14:20:00 -0700 | [diff] [blame] | 33 | name: "libhidl_gtest_helper", |
| 34 | export_include_dirs: ["gtest_helper"], |
Steven Moreland | e695c3e | 2019-08-21 15:36:22 -0700 | [diff] [blame] | 35 | } |
| 36 | |
Yifan Hong | 00f4a39 | 2016-11-16 12:35:58 -0800 | [diff] [blame] | 37 | cc_test { |
| 38 | name: "libhidl_test", |
Steven Moreland | 2056cf3 | 2019-09-17 17:41:02 -0700 | [diff] [blame] | 39 | host_supported: true, |
Steven Moreland | c75fc62 | 2017-08-04 11:04:39 -0700 | [diff] [blame] | 40 | defaults: ["libhidl-defaults"], |
Yifan Hong | 00f4a39 | 2016-11-16 12:35:58 -0800 | [diff] [blame] | 41 | gtest: false, |
| 42 | srcs: ["test_main.cpp"], |
Steven Moreland | 1745383 | 2019-02-25 12:01:22 -0800 | [diff] [blame] | 43 | test_suites: ["device-tests"], |
Yifan Hong | 00f4a39 | 2016-11-16 12:35:58 -0800 | [diff] [blame] | 44 | |
Dan Willemsen | 6365a87 | 2016-09-13 16:29:54 -0700 | [diff] [blame] | 45 | shared_libs: [ |
Steven Moreland | 138c350 | 2018-11-27 14:27:04 -0800 | [diff] [blame] | 46 | "android.hidl.memory@1.0", |
Dan Willemsen | 6365a87 | 2016-09-13 16:29:54 -0700 | [diff] [blame] | 47 | "libbase", |
Steven Moreland | 348563a | 2019-06-19 13:53:19 -0700 | [diff] [blame] | 48 | "libhidlbase", |
| 49 | "liblog", |
Dan Willemsen | 6365a87 | 2016-09-13 16:29:54 -0700 | [diff] [blame] | 50 | "libutils", |
Jeff Tinker | 0f3461d | 2017-01-03 10:40:55 -0800 | [diff] [blame] | 51 | "libcutils", |
Dan Willemsen | 6365a87 | 2016-09-13 16:29:54 -0700 | [diff] [blame] | 52 | ], |
Steven Moreland | 55d2dcd | 2020-02-10 17:20:56 -0800 | [diff] [blame] | 53 | static_libs: [ |
| 54 | "libgtest", |
| 55 | "libgmock", |
| 56 | ], |
Yifan Hong | 00f4a39 | 2016-11-16 12:35:58 -0800 | [diff] [blame] | 57 | |
| 58 | cflags: [ |
| 59 | "-O0", |
| 60 | "-g", |
Steven Moreland | c75fc62 | 2017-08-04 11:04:39 -0700 | [diff] [blame] | 61 | ], |
Dan Willemsen | 6365a87 | 2016-09-13 16:29:54 -0700 | [diff] [blame] | 62 | } |
Steven Moreland | a46371d | 2019-06-05 18:29:06 -0700 | [diff] [blame] | 63 | |
Steven Moreland | 9f53eda | 2019-06-17 17:17:02 -0700 | [diff] [blame] | 64 | cc_library { |
| 65 | name: "libhidlbase", |
| 66 | defaults: ["libhidlbase-combined-impl"], |
Steven Moreland | 2056cf3 | 2019-09-17 17:41:02 -0700 | [diff] [blame] | 67 | host_supported: true, |
Victor Khimenko | 538af7d | 2020-07-08 23:24:21 +0200 | [diff] [blame] | 68 | // TODO(b/153609531): remove when no longer needed. |
| 69 | native_bridge_supported: true, |
Steven Moreland | 9f53eda | 2019-06-17 17:17:02 -0700 | [diff] [blame] | 70 | recovery_available: true, |
| 71 | vendor_available: true, |
Justin Yun | 8ee9713 | 2020-11-11 19:23:49 +0900 | [diff] [blame^] | 72 | product_available: true, |
Przemyslaw Szczepaniak | 4f0d1e3 | 2020-02-13 20:01:04 +0000 | [diff] [blame] | 73 | apex_available: [ |
| 74 | // TODO(b/137948090): not fully supported in APEX for certain usecases |
| 75 | // - large dependency sizes |
| 76 | // - VINTF manifest cannot be read from APEX |
| 77 | // - no testing story/infra for deprecation schedule |
| 78 | "//apex_available:platform", |
| 79 | "com.android.neuralnetworks", |
| 80 | "test_com.android.neuralnetworks", |
Jiyong Park | 958a03f | 2020-03-07 17:23:16 +0900 | [diff] [blame] | 81 | "com.android.bluetooth.updatable", |
| 82 | "com.android.media", |
| 83 | "com.android.media.swcodec", |
| 84 | "com.android.tethering", |
Przemyslaw Szczepaniak | 4f0d1e3 | 2020-02-13 20:01:04 +0000 | [diff] [blame] | 85 | ], |
Steven Moreland | 9f53eda | 2019-06-17 17:17:02 -0700 | [diff] [blame] | 86 | vndk: { |
| 87 | enabled: true, |
| 88 | support_system_process: true, |
| 89 | }, |
| 90 | whole_static_libs: [ |
| 91 | "libhwbinder-impl-internal", |
| 92 | ], |
Jooyung Han | dfe14f1 | 2020-04-16 18:48:34 +0900 | [diff] [blame] | 93 | min_sdk_version: "29", |
Steven Moreland | 9f53eda | 2019-06-17 17:17:02 -0700 | [diff] [blame] | 94 | } |
| 95 | |
| 96 | // Only libhwbinder_benchmark needs to have pgo enabled. When all places |
| 97 | // support having PGO selectively enabled, all places can use libhwbinder. |
| 98 | // |
| 99 | // http://b/77320844 |
| 100 | cc_library { |
| 101 | name: "libhidlbase_pgo", |
| 102 | defaults: [ |
| 103 | "libhidlbase-combined-impl", |
| 104 | "hwbinder_benchmark_pgo", |
| 105 | ], |
| 106 | whole_static_libs: [ |
| 107 | "libhwbinder_pgo-impl-internal", |
| 108 | ], |
Steven Moreland | c6df565 | 2019-09-05 15:08:41 -0700 | [diff] [blame] | 109 | |
| 110 | visibility: ["//system/libhwbinder:__subpackages__"], |
Steven Moreland | 9f53eda | 2019-06-17 17:17:02 -0700 | [diff] [blame] | 111 | } |
| 112 | |
Steven Moreland | a46371d | 2019-06-05 18:29:06 -0700 | [diff] [blame] | 113 | // WARNING: deprecated |
Steven Moreland | a29e20f | 2020-07-07 23:35:46 +0000 | [diff] [blame] | 114 | // This library is no longer required, and dependencies should be taken on libhidlbase instead. |
| 115 | // This is automatically removed by bpfix. Once there are no makefiles, fixes can be automatically applied, and this can be removed. |
Steven Moreland | a46371d | 2019-06-05 18:29:06 -0700 | [diff] [blame] | 116 | cc_library { |
| 117 | name: "libhidltransport", |
Steven Moreland | a46371d | 2019-06-05 18:29:06 -0700 | [diff] [blame] | 118 | vendor_available: true, |
Steven Moreland | 13420fe | 2019-10-09 16:28:44 -0700 | [diff] [blame] | 119 | |
Dan Willemsen | f35a087 | 2020-06-09 15:09:11 -0700 | [diff] [blame] | 120 | visibility: [ |
| 121 | ":__subpackages__", |
| 122 | "//hardware:__subpackages__", |
| 123 | "//test/sts:__subpackages__", |
| 124 | "//vendor:__subpackages__", |
| 125 | ], |
Steven Moreland | a46371d | 2019-06-05 18:29:06 -0700 | [diff] [blame] | 126 | } |
Steven Moreland | 55d2dcd | 2020-02-10 17:20:56 -0800 | [diff] [blame] | 127 | |
| 128 | cc_defaults { |
| 129 | name: "libhidlbase-combined-impl", |
| 130 | |
| 131 | defaults: [ |
| 132 | "hidl-module-defaults", |
| 133 | "libhidl-defaults", |
| 134 | "libhwbinder-impl-shared-libs", |
| 135 | ], |
| 136 | |
| 137 | shared_libs: [ |
| 138 | "libbase", |
| 139 | "liblog", |
| 140 | "libutils", |
| 141 | "libcutils", |
| 142 | ], |
| 143 | export_shared_lib_headers: [ |
| 144 | "libcutils", // for native_handle.h |
| 145 | "libutils", |
| 146 | ], |
| 147 | static_libs: [ |
| 148 | "libhwbinder-impl-internal", |
| 149 | ], |
| 150 | |
| 151 | target: { |
| 152 | android: { |
| 153 | shared_libs: [ |
| 154 | "libvndksupport", |
| 155 | ], |
| 156 | }, |
| 157 | recovery: { |
| 158 | exclude_shared_libs: [ |
| 159 | "libvndksupport", |
| 160 | ], |
| 161 | }, |
| 162 | }, |
| 163 | |
| 164 | export_include_dirs: [ |
| 165 | "base/include", |
| 166 | "transport/include", |
| 167 | ], |
| 168 | |
Devin Moore | f9893e8 | 2020-07-08 08:17:39 -0700 | [diff] [blame] | 169 | header_libs: [ |
| 170 | "libfmq-base", |
| 171 | ], |
| 172 | export_header_lib_headers: [ |
| 173 | "libfmq-base", |
| 174 | ], |
| 175 | |
Steven Moreland | 55d2dcd | 2020-02-10 17:20:56 -0800 | [diff] [blame] | 176 | generated_sources: [ |
| 177 | "android.hidl.manager@1.0_genc++", |
| 178 | "android.hidl.manager@1.1_genc++", |
| 179 | "android.hidl.manager@1.2_genc++", |
| 180 | "android.hidl.base@1.0_genc++", |
| 181 | ], |
| 182 | generated_headers: [ |
| 183 | "android.hidl.manager@1.0_genc++_headers", |
| 184 | "android.hidl.manager@1.1_genc++_headers", |
| 185 | "android.hidl.manager@1.2_genc++_headers", |
| 186 | "android.hidl.base@1.0_genc++_headers", |
| 187 | ], |
| 188 | export_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 | |
| 195 | srcs: [ |
| 196 | "base/HidlInternal.cpp", |
| 197 | "base/HidlSupport.cpp", |
| 198 | "base/Status.cpp", |
| 199 | "base/TaskRunner.cpp", |
| 200 | "transport/HidlBinderSupport.cpp", |
| 201 | "transport/HidlLazyUtils.cpp", |
| 202 | "transport/HidlPassthroughSupport.cpp", |
| 203 | "transport/HidlTransportSupport.cpp", |
| 204 | "transport/HidlTransportUtils.cpp", |
| 205 | "transport/LegacySupport.cpp", |
| 206 | "transport/ServiceManagement.cpp", |
| 207 | "transport/Static.cpp", |
| 208 | ], |
| 209 | |
| 210 | product_variables: { |
| 211 | debuggable: { |
| 212 | cflags: ["-DLIBHIDL_TARGET_DEBUGGABLE"], |
| 213 | }, |
| 214 | enforce_vintf_manifest: { |
| 215 | cflags: ["-DENFORCE_VINTF_MANIFEST"], |
| 216 | }, |
| 217 | }, |
| 218 | |
| 219 | sanitize: { |
| 220 | misc_undefined: ["integer"], |
| 221 | }, |
| 222 | } |