1// 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 19cc_library_host_static { 20 name: "libecho_server", 21 shared_libs: [ 22 "libprotobuf-cpp-full", 23 "libgrpc++_unsecure", 24 ], 25 static_libs: [ 26 "libgflags", 27 ], 28 cflags: [ 29 "-Wno-unused-parameter", 30 ], 31 generated_headers: [ 32 "EchoServerProto_h", 33 ], 34 generated_sources: [ 35 "EchoServerProto_cc", 36 ], 37 export_generated_headers: [ 38 "EchoServerProto_h", 39 ], 40 defaults: ["cuttlefish_host"], 41 include_dirs: [ 42 "external/grpc-grpc/include", 43 "external/protobuf/src", 44 ], 45} 46 47cc_binary_host { 48 name: "echo_server", 49 shared_libs: [ 50 "libprotobuf-cpp-full", 51 "libgrpc++_unsecure", 52 ], 53 static_libs: [ 54 "libcuttlefish_host_config", 55 "libgflags", 56 "libecho_server", 57 "libgrpc++_reflection", 58 ], 59 srcs: [ 60 "main.cpp", 61 ], 62 cflags: [ 63 "-Wno-unused-parameter", 64 ], 65 defaults: ["cuttlefish_host"], 66} 67 68filegroup { 69 name: "EchoServerProto", 70 srcs: [ 71 "echo.proto", 72 ], 73} 74 75genrule { 76 name: "EchoServerProto_h", 77 tools: [ 78 "aprotoc", 79 "protoc-gen-grpc-cpp-plugin", 80 ], 81 cmd: "$(location aprotoc) -Idevice/google/cuttlefish/host/commands/echo_server -Iexternal/protobuf/src --plugin=protoc-gen-grpc=$(location protoc-gen-grpc-cpp-plugin) $(in) --grpc_out=$(genDir) --cpp_out=$(genDir)", 82 srcs: [ 83 ":EchoServerProto", 84 ], 85 out: [ 86 "echo.grpc.pb.h", 87 "echo.pb.h", 88 ], 89} 90 91genrule { 92 name: "EchoServerProto_cc", 93 tools: [ 94 "aprotoc", 95 "protoc-gen-grpc-cpp-plugin", 96 ], 97 cmd: "$(location aprotoc) -Idevice/google/cuttlefish/host/commands/echo_server -Iexternal/protobuf/src --plugin=protoc-gen-grpc=$(location protoc-gen-grpc-cpp-plugin) $(in) --grpc_out=$(genDir) --cpp_out=$(genDir)", 98 srcs: [ 99 ":EchoServerProto", 100 ], 101 out: [ 102 "echo.grpc.pb.cc", 103 "echo.pb.cc", 104 ], 105} 106