blob: 399ac4263c391d81526f3ab430fbd44fce8d083e [file] [log] [blame]
Dan Willemsenf7cc91b2016-09-13 16:35:00 -07001// 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
Yi Kong1a8beb62018-04-03 12:15:58 -070015cc_defaults {
16 name: "libhwbinder_defaults",
Steven Moreland09a87252019-06-17 17:18:02 -070017
Dan Willemsenf7cc91b2016-09-13 16:35:00 -070018 export_include_dirs: ["include"],
Dan Willemsenf7cc91b2016-09-13 16:35:00 -070019
Dan Willemsenf7cc91b2016-09-13 16:35:00 -070020 sanitize: {
21 misc_undefined: ["integer"],
22 },
23 srcs: [
24 "Binder.cpp",
Yifan Hong1e118d22017-01-12 14:42:28 -080025 "BpHwBinder.cpp",
Dan Willemsenf7cc91b2016-09-13 16:35:00 -070026 "BufferedTextOutput.cpp",
27 "Debug.cpp",
28 "IInterface.cpp",
29 "IPCThreadState.cpp",
30 "Parcel.cpp",
31 "ProcessState.cpp",
32 "Static.cpp",
33 "TextOutput.cpp",
34 ],
35
36 product_variables: {
37 binder32bit: {
38 cflags: ["-DBINDER_IPC_32BIT=1"],
39 },
40 },
41
Chih-Hung Hsieh29dbdcf2017-10-02 10:42:37 -070042 cflags: [
43 "-Wall",
44 "-Werror",
45 ],
46}
Zhizhou Yang5166bc52018-03-26 17:19:04 -070047
Steven Moreland09a87252019-06-17 17:18:02 -070048cc_defaults {
49 name: "libhwbinder-impl-shared-libs",
Steven Moreland09a87252019-06-17 17:18:02 -070050 shared_libs: [
51 "libbase",
52 "liblog",
53 "libcutils",
54 "libutils",
55 ],
56 export_shared_lib_headers: [
57 "libbase",
58 "libutils",
59 ],
60}
61
62// WARNING: this should no longer be used
Yi Kong1a8beb62018-04-03 12:15:58 -070063cc_library {
64 name: "libhwbinder",
Steven Moreland09a87252019-06-17 17:18:02 -070065 vendor_available: true,
Steven Moreland09a87252019-06-17 17:18:02 -070066
67 export_include_dirs: ["include"],
Steven Morelande8adbb12019-10-09 16:27:36 -070068
Daniel Norman8ffc8272019-10-28 14:51:40 -070069// TODO(b/144056694) Add back this visibility restriction.
Steven Lavera4dc5cd2019-11-14 08:37:39 -080070// visibility: [":__subpackages__"],
Steven Moreland09a87252019-06-17 17:18:02 -070071}
72
73// Combined into libhidlbase for efficiency.
74// Used as shared library to provide headers for libhidltransport-impl-internal.
75cc_library_static {
76 name: "libhwbinder-impl-internal",
Steven Morelandd9bdb652019-09-17 15:42:45 -070077 include_dirs: [
Steven Morelandd9bdb652019-09-17 15:42:45 -070078 // TODO(b/31559095): get headers from bionic on host
79 "bionic/libc/kernel/android/uapi/",
80 "bionic/libc/kernel/uapi/",
81 ],
82
Yi Kong1a8beb62018-04-03 12:15:58 -070083 defaults: [
84 "libhwbinder_defaults",
Steven Moreland3ba053c2020-01-31 14:58:48 -080085 "libhwbinder-impl-shared-libs",
Yi Kong1a8beb62018-04-03 12:15:58 -070086 "hwbinder_pgo",
Jayant Chowdhary985fc892018-10-01 22:54:05 +000087 "hwbinder_lto",
Yi Kong1a8beb62018-04-03 12:15:58 -070088 ],
Steven Morelandd9bdb652019-09-17 15:42:45 -070089 host_supported: true,
Steven Moreland09a87252019-06-17 17:18:02 -070090 recovery_available: true,
91 vendor_available: true,
Victor Khimenko8ad7e7a2020-07-03 00:23:21 +020092 // TODO(b/153609531): remove when no longer needed.
93 native_bridge_supported: true,
Jiyong Parkc61545c2020-03-07 17:27:13 +090094 apex_available: [
95 "//apex_available:platform",
96 "com.android.neuralnetworks",
97 "com.android.bluetooth.updatable",
98 "com.android.media",
99 "com.android.media.swcodec",
100 "com.android.tethering",
101 ],
Jooyung Han7cf2a1a2020-04-16 18:48:34 +0900102 min_sdk_version: "29",
Yi Kong1a8beb62018-04-03 12:15:58 -0700103}
104
Steven Moreland09a87252019-06-17 17:18:02 -0700105// Only libhwbinder_benchmark needs to have pgo enabled. When all places
106// support having PGO selectively enabled, all places can use libhwbinder.
107//
108// http://b/77320844
109cc_library_static {
110 name: "libhwbinder_pgo-impl-internal",
111 defaults: [
112 "libhwbinder_defaults",
113 "libhwbinder-impl-shared-libs",
114 "hwbinder_benchmark_pgo",
115 "hwbinder_lto",
Yi Kong1a8beb62018-04-03 12:15:58 -0700116 ],
117}
118
Zhizhou Yang5166bc52018-03-26 17:19:04 -0700119// Provide pgo property to build hwbinder with PGO
120cc_defaults {
121 name: "hwbinder_pgo",
122 pgo: {
123 instrumentation: true,
124 profile_file: "hwbinder/hwbinder.profdata",
125 benchmarks: ["hwbinder"],
126 enable_profile_use: true,
127 },
128}
Jayant Chowdhary985fc892018-10-01 22:54:05 +0000129
Steven Moreland09a87252019-06-17 17:18:02 -0700130cc_defaults {
131 name: "hwbinder_benchmark_pgo",
132 pgo: {
133 instrumentation: true,
134 profile_file: "hwbinder/hwbinder.profdata",
135 benchmarks: ["hwbinder_benchmark"],
136 enable_profile_use: true,
137 },
138}
139
Zhizhou Yang5166bc52018-03-26 17:19:04 -0700140// Provide lto property to build hwbinder with LTO
141cc_defaults {
142 name: "hwbinder_lto",
143 target: {
144 android: {
145 lto: {
146 thin: true,
147 },
148 },
149 },
150}