• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 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
19cc_library {
20    name: "libcasimir_control_server",
21    shared_libs: [
22        "libgrpc++_unsecure",
23        "libprotobuf-cpp-full",
24    ],
25    static_libs: [
26        "libgflags",
27    ],
28    cflags: [
29        "-Wno-unused-parameter",
30    ],
31    generated_headers: [
32        "CasimirControlServerProto_h",
33    ],
34    generated_sources: [
35        "CasimirControlServerProto_cc",
36    ],
37    export_generated_headers: [
38        "CasimirControlServerProto_h",
39    ],
40    defaults: ["cuttlefish_host"],
41    include_dirs: [
42        "external/grpc-grpc/include",
43        "external/protobuf/src",
44    ],
45    target: {
46        darwin: {
47            enabled: true,
48        },
49    },
50}
51
52cc_binary_host {
53    name: "casimir_control_server",
54    shared_libs: [
55        "libbase",
56        "libcuttlefish_fs",
57        "libcuttlefish_utils",
58        "libgrpc++_unsecure",
59        "libprotobuf-cpp-full",
60    ],
61    static_libs: [
62        "libcasimir_control_server",
63        "libcuttlefish_host_config",
64        "libgflags",
65        "libgrpc++_reflection",
66    ],
67    header_libs: ["casimir_rf_packets_cxx"],
68    srcs: [
69        "casimir_controller.cpp",
70        "hex.cpp",
71        "crc.cpp",
72        "main.cpp",
73    ],
74    cflags: [
75        "-Wno-unused-parameter",
76    ],
77    defaults: ["cuttlefish_host"],
78    target: {
79        darwin: {
80            enabled: true,
81        },
82    },
83}
84
85filegroup {
86    name: "CasimirControlServerProto",
87    srcs: [
88        ":libprotobuf-internal-protos",
89        "casimir_control.proto",
90    ],
91}
92
93genrule {
94    name: "CasimirControlServerProto_h",
95    tools: [
96        "aprotoc",
97        "protoc-gen-grpc-cpp-plugin",
98    ],
99    cmd: "$(location aprotoc) -Idevice/google/cuttlefish/host/commands/casimir_control_server -Iexternal/protobuf/src --plugin=protoc-gen-grpc=$(location protoc-gen-grpc-cpp-plugin) $(in) --grpc_out=$(genDir) --cpp_out=$(genDir)",
100    srcs: [
101        ":CasimirControlServerProto",
102    ],
103    out: [
104        "casimir_control.grpc.pb.h",
105        "casimir_control.pb.h",
106    ],
107}
108
109genrule {
110    name: "CasimirControlServerProto_cc",
111    tools: [
112        "aprotoc",
113        "protoc-gen-grpc-cpp-plugin",
114    ],
115    cmd: "$(location aprotoc) -Idevice/google/cuttlefish/host/commands/casimir_control_server -Iexternal/protobuf/src --plugin=protoc-gen-grpc=$(location protoc-gen-grpc-cpp-plugin) $(in) --grpc_out=$(genDir) --cpp_out=$(genDir)",
116    srcs: [
117        ":CasimirControlServerProto",
118    ],
119    out: [
120        "casimir_control.grpc.pb.cc",
121        "casimir_control.pb.cc",
122    ],
123}
124