blob: a5901e0f01ccd0dc61c818a5d2951d197b16eefe [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
Zhuoyao Zhangfaea9792017-09-08 14:38:20 -070015subdirs = [
16 "vts/performance",
17]
18
Yi Kong1a8beb62018-04-03 12:15:58 -070019cc_defaults {
20 name: "libhwbinder_defaults",
Steven Moreland09a87252019-06-17 17:18:02 -070021
Dan Willemsenf7cc91b2016-09-13 16:35:00 -070022 export_include_dirs: ["include"],
Dan Willemsencb209b32017-04-07 14:19:44 -070023 include_dirs: ["frameworks/native/include"],
Dan Willemsenf7cc91b2016-09-13 16:35:00 -070024
Dan Willemsenf7cc91b2016-09-13 16:35:00 -070025 sanitize: {
26 misc_undefined: ["integer"],
27 },
28 srcs: [
29 "Binder.cpp",
Yifan Hong1e118d22017-01-12 14:42:28 -080030 "BpHwBinder.cpp",
Dan Willemsenf7cc91b2016-09-13 16:35:00 -070031 "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 Hsieh29dbdcf2017-10-02 10:42:37 -070047 cflags: [
48 "-Wall",
49 "-Werror",
50 ],
51}
Zhizhou Yang5166bc52018-03-26 17:19:04 -070052
Steven Moreland09a87252019-06-17 17:18:02 -070053cc_defaults {
54 name: "libhwbinder-impl-shared-libs",
55 defaults: ["libhwbinder-impl-shared-libs-no-vndk-private"],
56 shared_libs: [
57 "libbinderthreadstate",
58 ],
59}
60
61cc_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 Kong1a8beb62018-04-03 12:15:58 -070076cc_library {
77 name: "libhwbinder",
Steven Moreland09a87252019-06-17 17:18:02 -070078 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.
90cc_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 Kong1a8beb62018-04-03 12:15:58 -070096 defaults: [
97 "libhwbinder_defaults",
Steven Moreland09a87252019-06-17 17:18:02 -070098 "libhwbinder-impl-shared-libs-no-vndk-private",
Yi Kong1a8beb62018-04-03 12:15:58 -070099 "hwbinder_pgo",
Jayant Chowdhary985fc892018-10-01 22:54:05 +0000100 "hwbinder_lto",
Yi Kong1a8beb62018-04-03 12:15:58 -0700101 ],
Steven Moreland09a87252019-06-17 17:18:02 -0700102 recovery_available: true,
103 vendor_available: true,
Yi Kong1a8beb62018-04-03 12:15:58 -0700104}
105
Pirama Arumuga Nainar62c976e2018-04-09 10:28:07 -0700106// 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 Moreland09a87252019-06-17 17:18:02 -0700108// TODO(b/135558503): remove
Yi Kong1a8beb62018-04-03 12:15:58 -0700109cc_library {
Pirama Arumuga Nainar62c976e2018-04-09 10:28:07 -0700110 name: "libhwbinder_noltopgo",
Yi Kong1a8beb62018-04-03 12:15:58 -0700111 defaults: [
112 "libhwbinder_defaults",
Steven Moreland09a87252019-06-17 17:18:02 -0700113 "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
127cc_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 Kong1a8beb62018-04-03 12:15:58 -0700134 ],
135}
136
Zhizhou Yang5166bc52018-03-26 17:19:04 -0700137// Provide pgo property to build hwbinder with PGO
138cc_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 Chowdhary985fc892018-10-01 22:54:05 +0000147
Steven Moreland09a87252019-06-17 17:18:02 -0700148cc_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 Yang5166bc52018-03-26 17:19:04 -0700158// Provide lto property to build hwbinder with LTO
159cc_defaults {
160 name: "hwbinder_lto",
161 target: {
162 android: {
163 lto: {
164 thin: true,
165 },
166 },
167 },
168}