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: "libopenwrt_control_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 "OpenwrtControlServerProto_h", 33 ], 34 generated_sources: [ 35 "OpenwrtControlServerProto_cc", 36 ], 37 export_generated_headers: [ 38 "OpenwrtControlServerProto_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: "openwrt_control_server", 49 shared_libs: [ 50 "libbase", 51 "libcuttlefish_utils", 52 "libprotobuf-cpp-full", 53 "libgrpc++_unsecure", 54 ], 55 static_libs: [ 56 "libcuttlefish_host_config", 57 "libgflags", 58 "libopenwrt_control_server", 59 "libgrpc++_reflection", 60 ], 61 srcs: [ 62 "main.cpp", 63 ], 64 cflags: [ 65 "-Wno-unused-parameter", 66 ], 67 defaults: ["cuttlefish_host"], 68} 69 70filegroup { 71 name: "OpenwrtControlServerProto", 72 srcs: [ 73 "openwrt_control.proto", 74 ], 75} 76 77genrule { 78 name: "OpenwrtControlServerProto_h", 79 tools: [ 80 "aprotoc", 81 "protoc-gen-grpc-cpp-plugin", 82 ], 83 cmd: "$(location aprotoc) -Idevice/google/cuttlefish/host/commands/openwrt_control_server -Iexternal/protobuf/src --plugin=protoc-gen-grpc=$(location protoc-gen-grpc-cpp-plugin) $(in) --grpc_out=$(genDir) --cpp_out=$(genDir)", 84 srcs: [ 85 ":OpenwrtControlServerProto", 86 ], 87 out: [ 88 "openwrt_control.grpc.pb.h", 89 "openwrt_control.pb.h", 90 ], 91} 92 93genrule { 94 name: "OpenwrtControlServerProto_cc", 95 tools: [ 96 "aprotoc", 97 "protoc-gen-grpc-cpp-plugin", 98 ], 99 cmd: "$(location aprotoc) -Idevice/google/cuttlefish/host/commands/openwrt_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 ":OpenwrtControlServerProto", 102 ], 103 out: [ 104 "openwrt_control.grpc.pb.cc", 105 "openwrt_control.pb.cc", 106 ], 107} 108