blob: 29f9b56e112856aa7b1884b1f92f4d7eb10dc51f [file] [log] [blame]
Dan Willemsen6365a872016-09-13 16:29:54 -07001// 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 Morelandc75fc622017-08-04 11:04:39 -070015cc_defaults {
16 name: "libhidl-defaults",
17 cflags: [
18 "-Wall",
Steven Moreland37814cb2018-10-24 16:28:35 -070019 "-Wdocumentation", // since some users use this
Steven Morelandc75fc622017-08-04 11:04:39 -070020 "-Werror",
Bernhard Rosenkränzer0c28fd22018-06-04 16:01:47 +020021 "-Wextra-semi",
Steven Morelandc75fc622017-08-04 11:04:39 -070022 ],
23}
Steven Moreland8dd65742017-02-17 22:39:46 -080024
Steven Moreland37e8d3a2019-04-26 12:33:21 -070025phony {
26 name: "libhidl",
27 required: [
28 "libhidlbase",
Steven Moreland37e8d3a2019-04-26 12:33:21 -070029 ],
30}
31
Steven Morelande695c3e2019-08-21 15:36:22 -070032cc_library_headers {
33 name: "libhidl_gtest_helpers",
34 export_include_dirs: ["gtest_helpers"],
35}
36
Yifan Hong00f4a392016-11-16 12:35:58 -080037cc_test {
38 name: "libhidl_test",
Steven Morelandc75fc622017-08-04 11:04:39 -070039 defaults: ["libhidl-defaults"],
Yifan Hong00f4a392016-11-16 12:35:58 -080040 gtest: false,
41 srcs: ["test_main.cpp"],
Steven Moreland17453832019-02-25 12:01:22 -080042 test_suites: ["device-tests"],
Yifan Hong00f4a392016-11-16 12:35:58 -080043
Dan Willemsen6365a872016-09-13 16:29:54 -070044 shared_libs: [
Steven Moreland138c3502018-11-27 14:27:04 -080045 "android.hidl.memory@1.0",
Dan Willemsen6365a872016-09-13 16:29:54 -070046 "libbase",
Steven Moreland348563a2019-06-19 13:53:19 -070047 "libhidlbase",
48 "liblog",
Dan Willemsen6365a872016-09-13 16:29:54 -070049 "libutils",
Jeff Tinker0f3461d2017-01-03 10:40:55 -080050 "libcutils",
Dan Willemsen6365a872016-09-13 16:29:54 -070051 ],
Steven Moreland348563a2019-06-19 13:53:19 -070052 static_libs: ["libgtest", "libgmock"],
Yifan Hong00f4a392016-11-16 12:35:58 -080053
54 cflags: [
55 "-O0",
56 "-g",
Steven Morelandc75fc622017-08-04 11:04:39 -070057 ],
Dan Willemsen6365a872016-09-13 16:29:54 -070058}
Steven Morelanda46371d2019-06-05 18:29:06 -070059
Steven Moreland9f53eda2019-06-17 17:17:02 -070060cc_defaults {
61 name: "libhidlbase-combined-impl",
Steven Morelanda46371d2019-06-05 18:29:06 -070062
63 defaults: [
Steven Moreland9f53eda2019-06-17 17:17:02 -070064 "libhwbinder-impl-shared-libs",
Steven Morelanda46371d2019-06-05 18:29:06 -070065 "libhidlbase-impl-shared-libs",
66 "libhidltransport-impl-shared-libs",
67 ],
68
69 whole_static_libs: [
70 "libhidlbase-impl-internal",
71 "libhidltransport-impl-internal",
72 ],
73}
74
Steven Moreland9f53eda2019-06-17 17:17:02 -070075cc_library {
76 name: "libhidlbase",
77 defaults: ["libhidlbase-combined-impl"],
78 recovery_available: true,
79 vendor_available: true,
80 vndk: {
81 enabled: true,
82 support_system_process: true,
83 },
84 whole_static_libs: [
85 "libhwbinder-impl-internal",
86 ],
87}
88
89// Only libhwbinder_benchmark needs to have pgo enabled. When all places
90// support having PGO selectively enabled, all places can use libhwbinder.
91//
92// http://b/77320844
93cc_library {
94 name: "libhidlbase_pgo",
95 defaults: [
96 "libhidlbase-combined-impl",
97 "hwbinder_benchmark_pgo",
98 ],
99 whole_static_libs: [
100 "libhwbinder_pgo-impl-internal",
101 ],
Steven Morelandc6df5652019-09-05 15:08:41 -0700102
103 visibility: ["//system/libhwbinder:__subpackages__"],
Steven Moreland9f53eda2019-06-17 17:17:02 -0700104}
105
Steven Morelanda46371d2019-06-05 18:29:06 -0700106// WARNING: deprecated
107// This library is no longer required, and dependencies should be taken
108// on libhidlbase instead.
109cc_library {
110 name: "libhidltransport",
111 recovery_available: true,
112 vendor_available: true,
113 vndk: {
114 enabled: true,
115 support_system_process: true,
116 },
117}