• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (C) 2017 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
15cc_defaults {
16    name: "vhal_v2_0_defaults",
17    shared_libs: [
18        "libhidlbase",
19        "liblog",
20        "libutils",
21        "android.hardware.automotive.vehicle@2.0",
22    ],
23    cflags: [
24        "-Wall",
25        "-Wextra",
26        "-Werror",
27    ],
28}
29
30cc_defaults {
31    name: "vhal_v2_0_target_defaults",
32    defaults: ["vhal_v2_0_defaults"],
33    shared_libs: [
34        "libbinder_ndk",
35        "carwatchdog_aidl_interface-ndk_platform",
36    ],
37}
38
39cc_library_headers {
40    name: "vhal_v2_0_common_headers",
41    vendor: true,
42    export_include_dirs: ["common/include/vhal_v2_0"],
43}
44
45// Vehicle reference implementation lib
46cc_library {
47    name: "android.hardware.automotive.vehicle@2.0-manager-lib",
48    vendor: true,
49    defaults: ["vhal_v2_0_target_defaults"],
50    srcs: [
51        "common/src/Obd2SensorStore.cpp",
52        "common/src/SubscriptionManager.cpp",
53        "common/src/VehicleHalManager.cpp",
54        "common/src/VehicleObjectPool.cpp",
55        "common/src/VehiclePropertyStore.cpp",
56        "common/src/VehicleUtils.cpp",
57        "common/src/VmsUtils.cpp",
58        "common/src/WatchdogClient.cpp",
59    ],
60    shared_libs: [
61        "libbase",
62    ],
63    local_include_dirs: ["common/include/vhal_v2_0"],
64    export_include_dirs: ["common/include"],
65}
66
67// Vehicle default VehicleHAL implementation
68cc_library_static {
69    name: "android.hardware.automotive.vehicle@2.0-default-impl-lib",
70    vendor: true,
71    defaults: ["vhal_v2_0_target_defaults"],
72    srcs: [
73        "impl/vhal_v2_0/CommConn.cpp",
74        "impl/vhal_v2_0/EmulatedVehicleConnector.cpp",
75        "impl/vhal_v2_0/EmulatedVehicleHal.cpp",
76        "impl/vhal_v2_0/VehicleHalClient.cpp",
77        "impl/vhal_v2_0/VehicleHalServer.cpp",
78        "impl/vhal_v2_0/VehicleEmulator.cpp",
79        "impl/vhal_v2_0/PipeComm.cpp",
80        "impl/vhal_v2_0/ProtoMessageConverter.cpp",
81        "impl/vhal_v2_0/SocketComm.cpp",
82        "impl/vhal_v2_0/LinearFakeValueGenerator.cpp",
83        "impl/vhal_v2_0/JsonFakeValueGenerator.cpp",
84        "impl/vhal_v2_0/GeneratorHub.cpp",
85    ],
86    local_include_dirs: ["common/include/vhal_v2_0"],
87    export_include_dirs: ["impl"],
88    whole_static_libs: [
89        "android.hardware.automotive.vehicle@2.0-emulated-user-hal-lib",
90        "android.hardware.automotive.vehicle@2.0-manager-lib",
91    ],
92    shared_libs: [
93        "libbase",
94        "libjsoncpp",
95        "libprotobuf-cpp-lite",
96    ],
97    static_libs: [
98        "libqemu_pipe",
99        "android.hardware.automotive.vehicle@2.0-libproto-native",
100    ],
101}
102
103// Library used  to emulate User HAL behavior through lshal debug requests.
104cc_library_static {
105    name: "android.hardware.automotive.vehicle@2.0-emulated-user-hal-lib",
106    vendor: true,
107    defaults: ["vhal_v2_0_target_defaults"],
108    srcs: [
109        "impl/vhal_v2_0/EmulatedUserHal.cpp",
110    ],
111    whole_static_libs: [
112        "android.hardware.automotive.vehicle@2.0-user-hal-helper-lib",
113    ],
114}
115
116// Vehicle HAL Server reference impl lib
117cc_library_static {
118    name: "android.hardware.automotive.vehicle@2.0-server-common-lib",
119    vendor: true,
120    host_supported: true,
121    defaults: ["vhal_v2_0_defaults"],
122    local_include_dirs: ["common/include/vhal_v2_0"],
123    export_include_dirs: ["common/include"],
124    srcs: [
125        "common/src/Obd2SensorStore.cpp",
126        "common/src/VehicleObjectPool.cpp",
127        "common/src/VehicleUtils.cpp",
128    ],
129}
130
131// Vehicle HAL Server default implementation
132cc_library_static {
133    name: "android.hardware.automotive.vehicle@2.0-server-impl-lib",
134    vendor: true,
135    host_supported: true,
136    defaults: ["vhal_v2_0_defaults"],
137    local_include_dirs: ["common/include/vhal_v2_0"],
138    export_include_dirs: ["impl"],
139    srcs: [
140        "impl/vhal_v2_0/GeneratorHub.cpp",
141        "impl/vhal_v2_0/JsonFakeValueGenerator.cpp",
142        "impl/vhal_v2_0/LinearFakeValueGenerator.cpp",
143        "impl/vhal_v2_0/ProtoMessageConverter.cpp",
144        "impl/vhal_v2_0/VehicleHalServer.cpp",
145    ],
146    whole_static_libs: [
147        "android.hardware.automotive.vehicle@2.0-server-common-lib",
148        "android.hardware.automotive.vehicle@2.0-user-hal-helper-lib",
149    ],
150    static_libs: [
151        "android.hardware.automotive.vehicle@2.0-libproto-native",
152    ],
153    shared_libs: [
154        "libbase",
155        "libjsoncpp",
156    ],
157}
158
159cc_test {
160    name: "android.hardware.automotive.vehicle@2.0-manager-unit-tests",
161    vendor: true,
162    defaults: ["vhal_v2_0_target_defaults"],
163    whole_static_libs: ["android.hardware.automotive.vehicle@2.0-manager-lib"],
164    srcs: [
165        "tests/RecurrentTimer_test.cpp",
166        "tests/SubscriptionManager_test.cpp",
167        "tests/VehicleHalManager_test.cpp",
168        "tests/VehicleObjectPool_test.cpp",
169        "tests/VehiclePropConfigIndex_test.cpp",
170        "tests/VmsUtils_test.cpp",
171    ],
172    shared_libs: [
173        "libbase",
174    ],
175    header_libs: ["libbase_headers"],
176    test_suites: ["general-tests"],
177}
178
179cc_test {
180    name: "android.hardware.automotive.vehicle@2.0-default-impl-unit-tests",
181    vendor: true,
182    defaults: ["vhal_v2_0_target_defaults"],
183    srcs: [
184        "impl/vhal_v2_0/tests/ProtoMessageConverter_test.cpp",
185    ],
186    static_libs: [
187        "android.hardware.automotive.vehicle@2.0-default-impl-lib",
188        "android.hardware.automotive.vehicle@2.0-libproto-native",
189        "libprotobuf-cpp-lite",
190    ],
191    test_suites: ["general-tests"],
192}
193
194cc_binary {
195    name: "android.hardware.automotive.vehicle@2.0-service",
196    defaults: ["vhal_v2_0_target_defaults"],
197    vintf_fragments: [
198        "android.hardware.automotive.vehicle@2.0-service.xml",
199    ],
200    init_rc: ["android.hardware.automotive.vehicle@2.0-service.rc"],
201    vendor: true,
202    relative_install_path: "hw",
203    srcs: ["VehicleService.cpp"],
204    shared_libs: [
205        "libbase",
206        "libjsoncpp",
207        "libprotobuf-cpp-lite",
208    ],
209    static_libs: [
210        "android.hardware.automotive.vehicle@2.0-manager-lib",
211        "android.hardware.automotive.vehicle@2.0-default-impl-lib",
212        "android.hardware.automotive.vehicle@2.0-libproto-native",
213        "libqemu_pipe",
214    ],
215}
216