Dan Willemsen | f7cc91b | 2016-09-13 16:35:00 -0700 | [diff] [blame] | 1 | // Copyright (C) 2009 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 | |
Zhuoyao Zhang | faea979 | 2017-09-08 14:38:20 -0700 | [diff] [blame] | 15 | subdirs = [ |
| 16 | "vts/performance", |
| 17 | ] |
| 18 | |
Yi Kong | 1a8beb6 | 2018-04-03 12:15:58 -0700 | [diff] [blame] | 19 | cc_defaults { |
| 20 | name: "libhwbinder_defaults", |
Steven Moreland | 09a8725 | 2019-06-17 17:18:02 -0700 | [diff] [blame] | 21 | |
Dan Willemsen | f7cc91b | 2016-09-13 16:35:00 -0700 | [diff] [blame] | 22 | export_include_dirs: ["include"], |
Dan Willemsen | cb209b3 | 2017-04-07 14:19:44 -0700 | [diff] [blame] | 23 | include_dirs: ["frameworks/native/include"], |
Dan Willemsen | f7cc91b | 2016-09-13 16:35:00 -0700 | [diff] [blame] | 24 | |
Dan Willemsen | f7cc91b | 2016-09-13 16:35:00 -0700 | [diff] [blame] | 25 | sanitize: { |
| 26 | misc_undefined: ["integer"], |
| 27 | }, |
| 28 | srcs: [ |
| 29 | "Binder.cpp", |
Yifan Hong | 1e118d2 | 2017-01-12 14:42:28 -0800 | [diff] [blame] | 30 | "BpHwBinder.cpp", |
Dan Willemsen | f7cc91b | 2016-09-13 16:35:00 -0700 | [diff] [blame] | 31 | "BufferedTextOutput.cpp", |
| 32 | "Debug.cpp", |
| 33 | "IInterface.cpp", |
| 34 | "IPCThreadState.cpp", |
| 35 | "Parcel.cpp", |
| 36 | "ProcessState.cpp", |
| 37 | "Static.cpp", |
| 38 | "TextOutput.cpp", |
| 39 | ], |
| 40 | |
| 41 | product_variables: { |
| 42 | binder32bit: { |
| 43 | cflags: ["-DBINDER_IPC_32BIT=1"], |
| 44 | }, |
| 45 | }, |
| 46 | |
Chih-Hung Hsieh | 29dbdcf | 2017-10-02 10:42:37 -0700 | [diff] [blame] | 47 | cflags: [ |
| 48 | "-Wall", |
| 49 | "-Werror", |
| 50 | ], |
| 51 | } |
Zhizhou Yang | 5166bc5 | 2018-03-26 17:19:04 -0700 | [diff] [blame] | 52 | |
Steven Moreland | 09a8725 | 2019-06-17 17:18:02 -0700 | [diff] [blame] | 53 | cc_defaults { |
| 54 | name: "libhwbinder-impl-shared-libs", |
| 55 | defaults: ["libhwbinder-impl-shared-libs-no-vndk-private"], |
| 56 | shared_libs: [ |
| 57 | "libbinderthreadstate", |
| 58 | ], |
| 59 | } |
| 60 | |
| 61 | cc_defaults { |
| 62 | name: "libhwbinder-impl-shared-libs-no-vndk-private", |
| 63 | shared_libs: [ |
| 64 | "libbase", |
| 65 | "liblog", |
| 66 | "libcutils", |
| 67 | "libutils", |
| 68 | ], |
| 69 | export_shared_lib_headers: [ |
| 70 | "libbase", |
| 71 | "libutils", |
| 72 | ], |
| 73 | } |
| 74 | |
| 75 | // WARNING: this should no longer be used |
Yi Kong | 1a8beb6 | 2018-04-03 12:15:58 -0700 | [diff] [blame] | 76 | cc_library { |
| 77 | name: "libhwbinder", |
Steven Moreland | 09a8725 | 2019-06-17 17:18:02 -0700 | [diff] [blame] | 78 | recovery_available: true, |
| 79 | vendor_available: true, |
| 80 | vndk: { |
| 81 | enabled: true, |
| 82 | support_system_process: true, |
| 83 | }, |
| 84 | |
| 85 | export_include_dirs: ["include"], |
| 86 | } |
| 87 | |
| 88 | // Combined into libhidlbase for efficiency. |
| 89 | // Used as shared library to provide headers for libhidltransport-impl-internal. |
| 90 | cc_library_static { |
| 91 | name: "libhwbinder-impl-internal", |
| 92 | // TODO(b/135299443): allow this library to link against vndk-private libs |
| 93 | // and instead rely on the fact that users of this static library must be |
| 94 | // vndk (since they must use libbinderthreadstate). |
| 95 | include_dirs: ["frameworks/native/libs/binderthreadstate/include/"], |
Yi Kong | 1a8beb6 | 2018-04-03 12:15:58 -0700 | [diff] [blame] | 96 | defaults: [ |
| 97 | "libhwbinder_defaults", |
Steven Moreland | 09a8725 | 2019-06-17 17:18:02 -0700 | [diff] [blame] | 98 | "libhwbinder-impl-shared-libs-no-vndk-private", |
Yi Kong | 1a8beb6 | 2018-04-03 12:15:58 -0700 | [diff] [blame] | 99 | "hwbinder_pgo", |
Jayant Chowdhary | 985fc89 | 2018-10-01 22:54:05 +0000 | [diff] [blame] | 100 | "hwbinder_lto", |
Yi Kong | 1a8beb6 | 2018-04-03 12:15:58 -0700 | [diff] [blame] | 101 | ], |
Steven Moreland | 09a8725 | 2019-06-17 17:18:02 -0700 | [diff] [blame] | 102 | recovery_available: true, |
| 103 | vendor_available: true, |
Yi Kong | 1a8beb6 | 2018-04-03 12:15:58 -0700 | [diff] [blame] | 104 | } |
| 105 | |
Pirama Arumuga Nainar | 62c976e | 2018-04-09 10:28:07 -0700 | [diff] [blame] | 106 | // Explicitly provide a no lto, no PGO variant, to workaround the issue that we |
| 107 | // can't detect non-lto users of the module in Android.mk. |
Steven Moreland | 09a8725 | 2019-06-17 17:18:02 -0700 | [diff] [blame] | 108 | // TODO(b/135558503): remove |
Yi Kong | 1a8beb6 | 2018-04-03 12:15:58 -0700 | [diff] [blame] | 109 | cc_library { |
Pirama Arumuga Nainar | 62c976e | 2018-04-09 10:28:07 -0700 | [diff] [blame] | 110 | name: "libhwbinder_noltopgo", |
Yi Kong | 1a8beb6 | 2018-04-03 12:15:58 -0700 | [diff] [blame] | 111 | defaults: [ |
| 112 | "libhwbinder_defaults", |
Steven Moreland | 09a8725 | 2019-06-17 17:18:02 -0700 | [diff] [blame] | 113 | "libhwbinder-impl-shared-libs", |
| 114 | ], |
| 115 | recovery_available: true, |
| 116 | vendor_available: true, |
| 117 | vndk: { |
| 118 | enabled: true, |
| 119 | support_system_process: true, |
| 120 | }, |
| 121 | } |
| 122 | |
| 123 | // Only libhwbinder_benchmark needs to have pgo enabled. When all places |
| 124 | // support having PGO selectively enabled, all places can use libhwbinder. |
| 125 | // |
| 126 | // http://b/77320844 |
| 127 | cc_library_static { |
| 128 | name: "libhwbinder_pgo-impl-internal", |
| 129 | defaults: [ |
| 130 | "libhwbinder_defaults", |
| 131 | "libhwbinder-impl-shared-libs", |
| 132 | "hwbinder_benchmark_pgo", |
| 133 | "hwbinder_lto", |
Yi Kong | 1a8beb6 | 2018-04-03 12:15:58 -0700 | [diff] [blame] | 134 | ], |
| 135 | } |
| 136 | |
Zhizhou Yang | 5166bc5 | 2018-03-26 17:19:04 -0700 | [diff] [blame] | 137 | // Provide pgo property to build hwbinder with PGO |
| 138 | cc_defaults { |
| 139 | name: "hwbinder_pgo", |
| 140 | pgo: { |
| 141 | instrumentation: true, |
| 142 | profile_file: "hwbinder/hwbinder.profdata", |
| 143 | benchmarks: ["hwbinder"], |
| 144 | enable_profile_use: true, |
| 145 | }, |
| 146 | } |
Jayant Chowdhary | 985fc89 | 2018-10-01 22:54:05 +0000 | [diff] [blame] | 147 | |
Steven Moreland | 09a8725 | 2019-06-17 17:18:02 -0700 | [diff] [blame] | 148 | cc_defaults { |
| 149 | name: "hwbinder_benchmark_pgo", |
| 150 | pgo: { |
| 151 | instrumentation: true, |
| 152 | profile_file: "hwbinder/hwbinder.profdata", |
| 153 | benchmarks: ["hwbinder_benchmark"], |
| 154 | enable_profile_use: true, |
| 155 | }, |
| 156 | } |
| 157 | |
Zhizhou Yang | 5166bc5 | 2018-03-26 17:19:04 -0700 | [diff] [blame] | 158 | // Provide lto property to build hwbinder with LTO |
| 159 | cc_defaults { |
| 160 | name: "hwbinder_lto", |
| 161 | target: { |
| 162 | android: { |
| 163 | lto: { |
| 164 | thin: true, |
| 165 | }, |
| 166 | }, |
| 167 | }, |
| 168 | } |