blob: 87560d1dd8072820a3b187e4c60df2e84045ad89 [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
# TODO(b/256272529): Figure out why this needs to be disabled on
# mimxrt595_evk.
if (host_os == "linux" ||
(get_label_info(current_toolchain, "name") != "host_debug" &&
pw_build_EXECUTABLE_TARGET_TYPE != "mimxrt595_executable")) {
deps += [ ":tokenizer_database" ]
}
}
pw_executable("rpc") {
sources = [ "main.cc" ]
deps = [
"$dir_pw_board_led",
"$dir_pw_spin_delay",
dir_pw_log,
dir_pw_span,
# 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" ]
}