blob: a69ba62a1ae909a195078091fd805a8b447c3f89 [file] [log] [blame] [edit]
// Copyright (C) 2023 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package {
default_applicable_licenses: ["Android-Apache-2.0"],
}
cc_library_host_static {
name: "libecho_server",
shared_libs: [
"libprotobuf-cpp-full",
"libgrpc++_unsecure",
],
static_libs: [
"libgflags",
],
cflags: [
"-Wno-unused-parameter",
],
generated_headers: [
"EchoServerProto_h",
],
generated_sources: [
"EchoServerProto_cc",
],
export_generated_headers: [
"EchoServerProto_h",
],
defaults: ["cuttlefish_host"],
include_dirs: [
"external/grpc-grpc/include",
"external/protobuf/src",
],
}
cc_binary_host {
name: "echo_server",
shared_libs: [
"libprotobuf-cpp-full",
"libgrpc++_unsecure",
],
static_libs: [
"libcuttlefish_host_config",
"libgflags",
"libecho_server",
"libgrpc++_reflection",
],
srcs: [
"main.cpp",
],
cflags: [
"-Wno-unused-parameter",
],
defaults: ["cuttlefish_host"],
}
filegroup {
name: "EchoServerProto",
srcs: [
"echo.proto",
],
}
genrule {
name: "EchoServerProto_h",
tools: [
"aprotoc",
"protoc-gen-grpc-cpp-plugin",
],
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)",
srcs: [
":EchoServerProto",
],
out: [
"echo.grpc.pb.h",
"echo.pb.h",
],
}
genrule {
name: "EchoServerProto_cc",
tools: [
"aprotoc",
"protoc-gen-grpc-cpp-plugin",
],
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)",
srcs: [
":EchoServerProto",
],
out: [
"echo.grpc.pb.cc",
"echo.pb.cc",
],
}