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 | |
Bob Badour | ad2415c | 2021-02-12 17:33:30 -0800 | [diff] [blame] | 15 | package { |
| 16 | default_applicable_licenses: ["system_libhidl_license"], |
| 17 | } |
| 18 | |
| 19 | // Added automatically by a large-scale-change |
| 20 | // See: http://go/android-license-faq |
| 21 | license { |
| 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 Moreland | c75fc62 | 2017-08-04 11:04:39 -0700 | [diff] [blame] | 32 | cc_defaults { |
| 33 | name: "libhidl-defaults", |
| 34 | cflags: [ |
| 35 | "-Wall", |
Steven Moreland | 37814cb | 2018-10-24 16:28:35 -0700 | [diff] [blame] | 36 | "-Wdocumentation", // since some users use this |
Steven Moreland | c75fc62 | 2017-08-04 11:04:39 -0700 | [diff] [blame] | 37 | "-Werror", |
Bernhard Rosenkränzer | 0c28fd2 | 2018-06-04 16:01:47 +0200 | [diff] [blame] | 38 | "-Wextra-semi", |
Steven Moreland | c75fc62 | 2017-08-04 11:04:39 -0700 | [diff] [blame] | 39 | ], |
| 40 | } |
Steven Moreland | 8dd6574 | 2017-02-17 22:39:46 -0800 | [diff] [blame] | 41 | |
Steven Moreland | 37e8d3a | 2019-04-26 12:33:21 -0700 | [diff] [blame] | 42 | phony { |
| 43 | name: "libhidl", |
| 44 | required: [ |
| 45 | "libhidlbase", |
Steven Moreland | 37e8d3a | 2019-04-26 12:33:21 -0700 | [diff] [blame] | 46 | ], |
| 47 | } |
| 48 | |
Steven Moreland | e695c3e | 2019-08-21 15:36:22 -0700 | [diff] [blame] | 49 | cc_library_headers { |
Steven Moreland | becd44e | 2019-10-29 14:20:00 -0700 | [diff] [blame] | 50 | name: "libhidl_gtest_helper", |
Jayant Chowdhary | d17de9f | 2022-05-18 06:51:51 +0000 | [diff] [blame] | 51 | vendor_available: true, |
Michael Butler | 9392373 | 2022-01-12 13:42:23 -0800 | [diff] [blame] | 52 | host_supported: true, |
Steven Moreland | becd44e | 2019-10-29 14:20:00 -0700 | [diff] [blame] | 53 | export_include_dirs: ["gtest_helper"], |
Steven Moreland | e695c3e | 2019-08-21 15:36:22 -0700 | [diff] [blame] | 54 | } |
| 55 | |
Yifan Hong | 00f4a39 | 2016-11-16 12:35:58 -0800 | [diff] [blame] | 56 | cc_test { |
| 57 | name: "libhidl_test", |
Steven Moreland | 2056cf3 | 2019-09-17 17:41:02 -0700 | [diff] [blame] | 58 | host_supported: true, |
Steven Moreland | c75fc62 | 2017-08-04 11:04:39 -0700 | [diff] [blame] | 59 | defaults: ["libhidl-defaults"], |
Yifan Hong | 00f4a39 | 2016-11-16 12:35:58 -0800 | [diff] [blame] | 60 | gtest: false, |
Chih-Hung Hsieh | 415623f | 2022-02-17 17:27:15 -0800 | [diff] [blame] | 61 | tidy_timeout_srcs: ["test_main.cpp"], |
Yifan Hong | 00f4a39 | 2016-11-16 12:35:58 -0800 | [diff] [blame] | 62 | srcs: ["test_main.cpp"], |
Steven Moreland | 1745383 | 2019-02-25 12:01:22 -0800 | [diff] [blame] | 63 | test_suites: ["device-tests"], |
Yifan Hong | 00f4a39 | 2016-11-16 12:35:58 -0800 | [diff] [blame] | 64 | |
Dan Willemsen | 6365a87 | 2016-09-13 16:29:54 -0700 | [diff] [blame] | 65 | shared_libs: [ |
Steven Moreland | 138c350 | 2018-11-27 14:27:04 -0800 | [diff] [blame] | 66 | "android.hidl.memory@1.0", |
Dan Willemsen | 6365a87 | 2016-09-13 16:29:54 -0700 | [diff] [blame] | 67 | "libbase", |
Steven Moreland | 348563a | 2019-06-19 13:53:19 -0700 | [diff] [blame] | 68 | "libhidlbase", |
| 69 | "liblog", |
Dan Willemsen | 6365a87 | 2016-09-13 16:29:54 -0700 | [diff] [blame] | 70 | "libutils", |
Jeff Tinker | 0f3461d | 2017-01-03 10:40:55 -0800 | [diff] [blame] | 71 | "libcutils", |
Dan Willemsen | 6365a87 | 2016-09-13 16:29:54 -0700 | [diff] [blame] | 72 | ], |
Steven Moreland | 55d2dcd | 2020-02-10 17:20:56 -0800 | [diff] [blame] | 73 | static_libs: [ |
| 74 | "libgtest", |
| 75 | "libgmock", |
| 76 | ], |
Yifan Hong | 00f4a39 | 2016-11-16 12:35:58 -0800 | [diff] [blame] | 77 | |
| 78 | cflags: [ |
| 79 | "-O0", |
| 80 | "-g", |
Steven Moreland | c75fc62 | 2017-08-04 11:04:39 -0700 | [diff] [blame] | 81 | ], |
Dan Willemsen | 6365a87 | 2016-09-13 16:29:54 -0700 | [diff] [blame] | 82 | } |
Steven Moreland | a46371d | 2019-06-05 18:29:06 -0700 | [diff] [blame] | 83 | |
Steven Moreland | 9f53eda | 2019-06-17 17:17:02 -0700 | [diff] [blame] | 84 | cc_library { |
| 85 | name: "libhidlbase", |
| 86 | defaults: ["libhidlbase-combined-impl"], |
Steven Moreland | 2056cf3 | 2019-09-17 17:41:02 -0700 | [diff] [blame] | 87 | host_supported: true, |
Victor Khimenko | 538af7d | 2020-07-08 23:24:21 +0200 | [diff] [blame] | 88 | // TODO(b/153609531): remove when no longer needed. |
| 89 | native_bridge_supported: true, |
Steven Moreland | 9f53eda | 2019-06-17 17:17:02 -0700 | [diff] [blame] | 90 | recovery_available: true, |
| 91 | vendor_available: true, |
Justin Yun | 8ee9713 | 2020-11-11 19:23:49 +0900 | [diff] [blame] | 92 | product_available: true, |
Przemyslaw Szczepaniak | 4f0d1e3 | 2020-02-13 20:01:04 +0000 | [diff] [blame] | 93 | 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 Ruffieux | a708579 | 2021-12-15 15:35:59 +0000 | [diff] [blame] | 101 | "com.android.bluetooth", |
Jiyong Park | 958a03f | 2020-03-07 17:23:16 +0900 | [diff] [blame] | 102 | "com.android.media", |
| 103 | "com.android.media.swcodec", |
| 104 | "com.android.tethering", |
Przemyslaw Szczepaniak | 4f0d1e3 | 2020-02-13 20:01:04 +0000 | [diff] [blame] | 105 | ], |
Steven Moreland | 9f53eda | 2019-06-17 17:17:02 -0700 | [diff] [blame] | 106 | vndk: { |
| 107 | enabled: true, |
| 108 | support_system_process: true, |
| 109 | }, |
| 110 | whole_static_libs: [ |
| 111 | "libhwbinder-impl-internal", |
| 112 | ], |
Jooyung Han | dfe14f1 | 2020-04-16 18:48:34 +0900 | [diff] [blame] | 113 | min_sdk_version: "29", |
Yi Kong | 314387e | 2022-01-12 09:39:19 +0800 | [diff] [blame] | 114 | afdo: true, |
Hsin-Yi Chen | 3697166 | 2022-05-26 14:00:56 +0800 | [diff] [blame] | 115 | header_abi_checker: { |
| 116 | diff_flags: ["-allow-adding-removing-weak-symbols"], |
| 117 | }, |
Steven Moreland | 9f53eda | 2019-06-17 17:17:02 -0700 | [diff] [blame] | 118 | } |
| 119 | |
Steven Moreland | a46371d | 2019-06-05 18:29:06 -0700 | [diff] [blame] | 120 | // WARNING: deprecated |
Steven Moreland | a29e20f | 2020-07-07 23:35:46 +0000 | [diff] [blame] | 121 | // 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 Moreland | a46371d | 2019-06-05 18:29:06 -0700 | [diff] [blame] | 123 | cc_library { |
| 124 | name: "libhidltransport", |
Steven Moreland | a46371d | 2019-06-05 18:29:06 -0700 | [diff] [blame] | 125 | vendor_available: true, |
Steven Moreland | 13420fe | 2019-10-09 16:28:44 -0700 | [diff] [blame] | 126 | |
Dan Willemsen | f35a087 | 2020-06-09 15:09:11 -0700 | [diff] [blame] | 127 | visibility: [ |
| 128 | ":__subpackages__", |
| 129 | "//hardware:__subpackages__", |
| 130 | "//test/sts:__subpackages__", |
| 131 | "//vendor:__subpackages__", |
| 132 | ], |
Steven Moreland | a46371d | 2019-06-05 18:29:06 -0700 | [diff] [blame] | 133 | } |
Steven Moreland | 55d2dcd | 2020-02-10 17:20:56 -0800 | [diff] [blame] | 134 | |
| 135 | cc_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 Moore | f9893e8 | 2020-07-08 08:17:39 -0700 | [diff] [blame] | 176 | header_libs: [ |
| 177 | "libfmq-base", |
| 178 | ], |
| 179 | export_header_lib_headers: [ |
| 180 | "libfmq-base", |
| 181 | ], |
| 182 | |
Steven Moreland | 55d2dcd | 2020-02-10 17:20:56 -0800 | [diff] [blame] | 183 | 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 | } |