blob: 174cefc5fb7fe449496603560534d90890c7353f [file] [log] [blame]
# Copyright 2021 The Pigweed Authors
#
# 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
#
# https://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.
import("//build_overrides/pigweed.gni")
import("$dir_pw_build/target_types.gni")
import("$dir_pw_protobuf_compiler/proto.gni")
import("$dir_pw_third_party/nanopb/nanopb.gni")
import("$dir_pw_tokenizer/database.gni")
config("default_config") {
include_dirs = [ "public" ]
}
group("all") {
deps = [ ":rpc" ]
# Build tokenizer_database for elf binaries only
if (host_os == "linux" || current_toolchain != "//targets/host:host_debug") {
deps += [ ":tokenizer_database" ]
}
}
pw_executable("rpc") {
sources = [ "main.cc" ]
deps = [
"$dir_pw_board_led",
"$dir_pw_spin_delay",
dir_pw_log,
# RPC related dependencies.
"$dir_pw_hdlc:pw_rpc",
"$dir_pw_hdlc:rpc_channel_output",
"$dir_pw_rpc:server",
"$dir_pw_stream:sys_io_stream",
dir_pw_hdlc,
# This is the service we are implementing!
":remoticon_service_nanopb",
# This is an example service that just responds with that it was sent.
"$dir_pw_rpc/nanopb:echo_service",
]
}
pw_tokenizer_database("tokenizer_database") {
database = "tokenizer_database.csv"
targets = [ ":rpc" ]
}
################################################################################
# Service
pw_proto_library("remoticon_proto") {
sources = [ "remoticon_proto/remoticon.proto" ]
}
pw_source_set("remoticon_service_nanopb") {
public_configs = [ ":default_config" ]
public_deps = [ ":remoticon_proto.nanopb_rpc" ]
public = [ "public/remoticon/remoticon_service_nanopb.h" ]
deps = [ ":remoticon_proto.nanopb_rpc" ]
sources = [ "remoticon_service_nanopb.cc" ]
}