blob: e5106f8da33ea3c2895888191fabbe2b7c3d03fe [file] [log] [blame]
Hao Chen6cb86892023-04-10 15:21:59 -07001// Copyright (C) 2023 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
15package {
16 default_applicable_licenses: ["Android-Apache-2.0"],
17}
18
19genrule {
20 name: "VehicleServerProtoStub_h@default-grpc",
21 tools: [
22 "aprotoc",
23 "protoc-gen-grpc-cpp-plugin",
24 ],
Cole Faust52d74462023-11-20 14:35:58 -080025 cmd: "$(location aprotoc) -I$$(dirname $(location proto/VehicleServer.proto)) -Ihardware/interfaces/automotive/vehicle/aidl/impl/proto -Iexternal/protobuf/src --plugin=protoc-gen-grpc=$(location protoc-gen-grpc-cpp-plugin) $(location proto/VehicleServer.proto) --grpc_out=$(genDir) --cpp_out=$(genDir)",
Hao Chen6cb86892023-04-10 15:21:59 -070026 srcs: [
27 "proto/VehicleServer.proto",
Cole Faust52d74462023-11-20 14:35:58 -080028 ":libprotobuf-internal-protos",
29 ":VehicleHalProtoFiles",
Hao Chen6cb86892023-04-10 15:21:59 -070030 ],
31 out: [
32 "VehicleServer.pb.h",
33 "VehicleServer.grpc.pb.h",
34 ],
35 visibility: ["//visibility:private"],
36}
37
38genrule {
39 name: "VehicleServerProtoStub_cc@default-grpc",
40 tools: [
41 "aprotoc",
42 "protoc-gen-grpc-cpp-plugin",
43 ],
Cole Faust52d74462023-11-20 14:35:58 -080044 cmd: "$(location aprotoc) -I$$(dirname $(location proto/VehicleServer.proto)) -Ihardware/interfaces/automotive/vehicle/aidl/impl/proto -Iexternal/protobuf/src --plugin=protoc-gen-grpc=$(location protoc-gen-grpc-cpp-plugin) $(location proto/VehicleServer.proto) --grpc_out=$(genDir) --cpp_out=$(genDir)",
Hao Chen6cb86892023-04-10 15:21:59 -070045 srcs: [
46 "proto/VehicleServer.proto",
Cole Faust52d74462023-11-20 14:35:58 -080047 ":libprotobuf-internal-protos",
48 ":VehicleHalProtoFiles",
Hao Chen6cb86892023-04-10 15:21:59 -070049 ],
50 out: [
51 "VehicleServer.pb.cc",
52 "VehicleServer.grpc.pb.cc",
53 ],
54 visibility: ["//visibility:private"],
55}
56
57cc_library_static {
58 name: "android.hardware.automotive.vehicle@default-grpc-libgrpc",
59 vendor: true,
60 host_supported: true,
61 include_dirs: [
62 "external/protobuf/src",
63 ],
64 generated_headers: [
65 "VehicleServerProtoStub_h@default-grpc",
66 ],
67 export_generated_headers: [
68 "VehicleServerProtoStub_h@default-grpc",
69 ],
70 generated_sources: [
71 "VehicleServerProtoStub_cc@default-grpc",
72 ],
73 whole_static_libs: [
74 "VehicleHalProtos",
75 ],
76 shared_libs: [
77 "libgrpc++",
78 ],
79 cflags: [
80 "-Wno-unused-parameter",
81 ],
82}
83
84cc_library_static {
85 name: "android.hardware.automotive.vehicle@default-grpc-hardware-lib",
86 defaults: ["VehicleHalDefaults"],
87 vendor: true,
88 srcs: [
89 "GRPCVehicleHardware.cpp",
90 ],
91 whole_static_libs: [
92 "android.hardware.automotive.vehicle@default-grpc-libgrpc",
93 "VehicleHalProtoMessageConverter",
94 ],
95 header_libs: [
96 "IVehicleHardware",
97 ],
98 shared_libs: [
99 "libgrpc++",
100 "libprotobuf-cpp-full",
101 ],
102 export_include_dirs: ["."],
103 cflags: [
104 "-Wno-unused-parameter",
105 ],
106}
Hao Chen32d46702023-04-10 15:59:50 -0700107
108cc_library_static {
109 name: "android.hardware.automotive.vehicle@default-grpc-server-lib",
110 defaults: ["VehicleHalDefaults"],
111 vendor: true,
112 srcs: [
113 "GRPCVehicleProxyServer.cpp",
114 ],
115 whole_static_libs: [
116 "android.hardware.automotive.vehicle@default-grpc-libgrpc",
117 "VehicleHalProtoMessageConverter",
118 ],
119 header_libs: [
120 "IVehicleHardware",
121 ],
122 shared_libs: [
123 "libgrpc++",
124 "libprotobuf-cpp-full",
125 ],
126 export_include_dirs: ["."],
127 cflags: [
128 "-Wno-unused-parameter",
129 ],
130}