blob: 72ef0c570ae8faceeadc888a37be4c4800fdc50a [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 Moreland2056cf32019-09-17 17:41:02 -070039 host_supported: true,
Steven Morelandc75fc622017-08-04 11:04:39 -070040 defaults: ["libhidl-defaults"],
Yifan Hong00f4a392016-11-16 12:35:58 -080041 gtest: false,
42 srcs: ["test_main.cpp"],
Steven Moreland17453832019-02-25 12:01:22 -080043 test_suites: ["device-tests"],
Yifan Hong00f4a392016-11-16 12:35:58 -080044
Dan Willemsen6365a872016-09-13 16:29:54 -070045 shared_libs: [
Steven Moreland138c3502018-11-27 14:27:04 -080046 "android.hidl.memory@1.0",
Dan Willemsen6365a872016-09-13 16:29:54 -070047 "libbase",
Steven Moreland348563a2019-06-19 13:53:19 -070048 "libhidlbase",
49 "liblog",
Dan Willemsen6365a872016-09-13 16:29:54 -070050 "libutils",
Jeff Tinker0f3461d2017-01-03 10:40:55 -080051 "libcutils",
Dan Willemsen6365a872016-09-13 16:29:54 -070052 ],
Steven Moreland348563a2019-06-19 13:53:19 -070053 static_libs: ["libgtest", "libgmock"],
Yifan Hong00f4a392016-11-16 12:35:58 -080054
55 cflags: [
56 "-O0",
57 "-g",
Steven Morelandc75fc622017-08-04 11:04:39 -070058 ],
Dan Willemsen6365a872016-09-13 16:29:54 -070059}
Steven Morelanda46371d2019-06-05 18:29:06 -070060
Steven Moreland9f53eda2019-06-17 17:17:02 -070061cc_defaults {
62 name: "libhidlbase-combined-impl",
Steven Morelanda46371d2019-06-05 18:29:06 -070063
64 defaults: [
Steven Moreland9f53eda2019-06-17 17:17:02 -070065 "libhwbinder-impl-shared-libs",
Steven Morelanda46371d2019-06-05 18:29:06 -070066 "libhidlbase-impl-shared-libs",
67 "libhidltransport-impl-shared-libs",
68 ],
69
70 whole_static_libs: [
71 "libhidlbase-impl-internal",
72 "libhidltransport-impl-internal",
73 ],
74}
75
Steven Moreland9f53eda2019-06-17 17:17:02 -070076cc_library {
77 name: "libhidlbase",
78 defaults: ["libhidlbase-combined-impl"],
Steven Moreland2056cf32019-09-17 17:41:02 -070079 host_supported: true,
Steven Moreland9f53eda2019-06-17 17:17:02 -070080 recovery_available: true,
81 vendor_available: true,
82 vndk: {
83 enabled: true,
84 support_system_process: true,
85 },
86 whole_static_libs: [
87 "libhwbinder-impl-internal",
88 ],
89}
90
91// Only libhwbinder_benchmark needs to have pgo enabled. When all places
92// support having PGO selectively enabled, all places can use libhwbinder.
93//
94// http://b/77320844
95cc_library {
96 name: "libhidlbase_pgo",
97 defaults: [
98 "libhidlbase-combined-impl",
99 "hwbinder_benchmark_pgo",
100 ],
101 whole_static_libs: [
102 "libhwbinder_pgo-impl-internal",
103 ],
Steven Morelandc6df5652019-09-05 15:08:41 -0700104
105 visibility: ["//system/libhwbinder:__subpackages__"],
Steven Moreland9f53eda2019-06-17 17:17:02 -0700106}
107
Steven Morelanda46371d2019-06-05 18:29:06 -0700108// WARNING: deprecated
109// This library is no longer required, and dependencies should be taken
110// on libhidlbase instead.
111cc_library {
112 name: "libhidltransport",
Steven Morelanda46371d2019-06-05 18:29:06 -0700113 vendor_available: true,
Steven Moreland13420fe2019-10-09 16:28:44 -0700114
Daniel Normanf8977fe2019-10-28 14:52:07 -0700115// TODO(b/144056694) Add back this visibility restriction.
116// visibility: [
117// "//device:__subpackages__",
118// "//vendor:__subpackages__",
119// ],
Steven Morelanda46371d2019-06-05 18:29:06 -0700120}